hunk.code_window:         if (options.fallback) {
             items = [FALLBACK];
             mapped[0] = createRoot(disposer => {
               disposers[0] = disposer;
               return options.fallback!();
             });
             len = 1;
           }
           return mapped;
         }
  
hunk.labels: keep keep keep keep keep replace keep keep keep keep
hunk.after_edit:           }, ctx);
  
hunk.file_path: packages/solid/src/reactive/array.ts
hunk.type: replace
file: import { createComputed, untrack } from "solid-js";
  
  const SymbolCopy = Symbol as any;
  const $$observable = SymbolCopy.observable || (SymbolCopy.observable = Symbol("observable"));
  
  type ObservableObserver<T> =
    | ((v: T) => void)
    | {
        next: (v: T) => void;
        error?: (v: any) => void;
        complete?: (v: boolean) => void;
      };
  export function observable<T>(input: () => T) {
    return {
      subscribe(observer: ObservableObserver<T>) {
        if (!(observer instanceof Object) || observer == null) {
          throw new TypeError("Expected the observer to be an object.");
        }
        const handler = "next" in observer ? observer.next : observer;
        let complete = false;
        createComputed(() => {
          const v = input();
          if (complete) return;
          untrack(() => handler(v));
        });
        return {
          unsubscribe() {
            complete = true;
          }
        };
      },
      [$$observable]() {
        return this;
      }
    };
  }
  