hunk.code_window: import {
     createContext,
     createState,
     createEffect,
     onMount,
     onCleanup,
     splitProps,
     useContext,
     Component,
  
hunk.labels: keep keep keep replace keep keep keep keep keep
hunk.after_edit:   createComputed,
  
hunk.file_path: packages/solid-meta/src/index.tsx
hunk.type: replace
file: import { createMemo, untrack } from "solid-js";
  
  export function filter<T>(fn: (v: T) => boolean): (v: () => T) => () => T;
  export function filter<T>(input: () => T, fn: (v: T) => boolean): () => T;
  export function filter<T>(input: any, fn?: (v: T) => boolean): any {
    if (arguments.length === 1) {
      fn = input;
      return filter;
    }
    return filter(input);
  
    function filter(input: () => T) {
      let value: T;
      const trigger = createMemo(
        () => {
          value = input();
          return untrack(() => fn!(value));
        },
        undefined,
        (_, next) => next === false
      );
      return () => trigger() && value;
    }
  }
  