PersistedInput: InputNode<T> & { dispose(): void }

The handle persistedInput returns: a normal InputNode that is also disposable.

Type Parameters

  • T

    Stored value type.

Type declaration

  • dispose:function
    • Stop the storage write-through and release the internal subscribeCommits registration. Idempotent.

      Returns void

Assignable to InputNode<T> everywhere it was before, so existing call sites that read/write the node are unaffected. The addition is dispose(): without it the internal subscribeCommits registration lived forever (its Unsubscribe was discarded), so a persisted input created inside a component/route that later unmounts kept writing to storage on every commit for the life of the graph. Callers that own a bounded lifetime now call dispose() to stop the write-through and release the subscription. dispose() is idempotent. The node itself is not removed from the graph, only the persistence side-effect is detached.