Skip to content

Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows - all through natural language commands.

TypeScript
334 B
Raw Blame
/**
 * A hook that keeps each input it is asked with, and answers, beside what
 * it kept.
 *
 * @returns the hook, and each input in the order it came
 */
export function keeping<E>() {
  const kept: E[] = []

  function hook(_engine: unknown, e: E) {
    kept.push(e)

    return { value: undefined }
  }

  return { hook, kept }
}