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

    Interface StoreOperationOptions<PARAMS>

    Options for operations with the store.

    interface StoreOperationOptions<PARAMS = any> {
        author?: Author;
        autoSelect?: boolean | ITypes.SelectOptions;
        description?: string;
        expectedCommitId?: string;
        meta?: Record<string, string>;
        operation?: Operation<PARAMS>;
        preventFurtherTransactions?: boolean;
        readOnly?: boolean;
        savepoint?: boolean;
        writes?: readonly string[];
        flush?(): void;
        onCommit?(commit: ICommit): void;
        onRollback?(): void;
    }

    Type Parameters

    • PARAMS = any

    Hierarchy (View Summary)

    Index
    author?: Author

    Who authored this change. Recorded on the commit (ICommit.getAuthor).

    the store's author, else null (unattributed)

    autoSelect?: boolean | ITypes.SelectOptions

    If true or set then this will select the affect item after the transaction is complete.

    If this is set to true then any restore will also select.

    description?: string

    A human description.

    'determined by the set operation and locale'
    
    expectedCommitId?: string

    Optimistic concurrency guard. If set, the operation only begins if the store's current commit id matches; otherwise a TransactionConflictError is thrown.

    The check happens atomically as the root transaction begins — there is no window between check and commit. If any transaction is already open the check fails with reason open (the head could move beneath the operation).

    meta?: Record<string, string>

    Stored with the commit.

    operation?: Operation<PARAMS>

    Used to record audit points.

    preventFurtherTransactions?: boolean

    If set to true, prevents further transactions from being pushed onto the stack until the current transaction is complete. Once the current transaction is either committed or rolled back, this restriction is automatically lifted.

    false
    
    readOnly?: boolean

    Declares the operation read-only: any state update within it throws.

    false
    

    Writes are tracked automatically — a batch that performs no updates never creates a commit (no new commit id, no events, no undo entry) whether or not this is set. The flag is purely an assertion for callers that want the guarantee enforced. Nested transactions inherit it; they cannot opt back out.

    savepoint?: boolean

    false begins a nested transaction as a step of the one it is nested in: it shares that one's ITransaction.getSavepointId, so structures the two change in place are the same copies. For a transaction that wraps one write. A rollback of it alone does not restore what it changed in place.

    true
    
    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