form-graph
    Preparing search index...

    Function persistedStorage

    • The batteries-included web-storage adapter: JSON (de)serialization over localStorage (or sessionStorage), writes debounced off the keystroke path, and a synchronous flush wired to pagehide/visibilitychange so a closing tab cannot lose the last change.

      Returns undefined outside a browser (SSR) — StoreOptions.storage accepts that directly:

      const store = form.createStore({ ext, storage: persistedStorage('my-form') });

      The flush listeners live for the page's lifetime, sized for the common case of one store per page; call the returned adapter's dispose() if a store is torn down early.

      Parameters

      • key: string
      • Optionaloptions: { delayMs?: number; session?: boolean }

      Returns DebouncedStorageAdapter & { dispose(): void } | undefined