SheetXL - v0.8.0-beta.9+sites.210.e2d420901
    Preparing search index...

    Callbacks a transaction is begun with, called by the store as the transaction and the operation it belongs to settle.

    A nested transaction is a savepoint: committing it merges its writes into its parent, where they can still be rolled back with an outer transaction. So the outcome hooks report the OPERATION's outcome - onCommit once the root lands, onRollback when this transaction or any one it is nested in rolls back - and only one of them is ever called.

    interface Hooks {
        writes?: readonly string[];
        flush?(): void;
        onCommit?(commit: ICommit): void;
        onRollback?(): void;
    }

    Hierarchy (View Summary)

    Index
    writes?: readonly string[]

    The records flush writes: a read of one from the store (IStore.getState) flushes first, so a reader never sees them without the held writes.

    Only the records the held writes change - a reader of anything else, including the writer itself deciding what to hold, reads as it would. A read made through a transaction (ITransaction.getState) sees that transaction and does not flush.

    • Make the writes the caller holds for this transaction, into it.

      Returns void

      The caller holds writes to make them together; the store calls this whenever something needs them made: before another transaction begins inside this one, before this one commits, and before a read of a record the writes change (writes). A flush writes by beginning transactions inside this one; those do not flush it again.

    • Called once the operation this transaction belongs to has landed.

      Parameters

      • commit: ICommit

        The root's commit. An operation that wrote nothing is elided but still counts as landed.

      Returns void

    • Called when this transaction, or any transaction it is nested in, rolls back.

      Returns void