Trilium Frontend API
    Preparing search index...

    Interface SpacedUpdateBinding<T>

    Binds pending changes to the target they belong to (see #9614).

    A change scheduled while one binding is active is always snapshotted (via SpacedUpdateBinding.prepare) before the binding can be swapped to a different key, and the snapshot is committed together with the commit closure that was current when it was taken. This makes it impossible for a pending change to be persisted under a different target than the one it was made against, no matter when the save fires.

    interface SpacedUpdateBinding<T> {
        commit: CommitCallback<T>;
        key: string;
        prepare: PrepareCallback<T>;
    }

    Type Parameters

    • T
    Index

    Properties

    Properties

    commit: CommitCallback<T>

    Persists a snapshot. Retries always reuse the closure that was current when the snapshot was taken.

    key: string

    Identity of the save target (e.g. a noteId). Pending changes never cross a key change.

    prepare: PrepareCallback<T>

    Snapshots the live state that should be saved. May refuse by returning a value commit treats as a no-op.