Close the transaction by folding its writes into the commit it opened on, rather than adding a step to the history.
Optionaloptions: StoreOperationOptions<P>
A final description or options to apply, as for commit.
The same fold as IStore.amend, which names the commit it lands in; this one always
lands in the commit this transaction began from. Reach for IStore.amend when the writes
belong to a commit you can name - what a calculation produced, where a listener registered -
and this when they belong to wherever you started: a model folding its own initialization
into the load it is happening during.
Either way the writes add no undo entry and no audit of their own; they are undone with the commit they land in. On a nested transaction there is nothing to fold into and this is commit: the writes join the operation that is open, which is already not a step of their own.
Begin a transaction with self contained, non-eventing updates.
Optionaloptions: StoreOperationOptions<any>
The description of the transaction or options.
OptionalonClose: CloseCallback
A callback for when the transaction is closed (due to either a commit or rollback).
Commit the transaction and all children transactions to the parent transaction.
Optionaloptions: StoreOperationOptions<P>
A final description or options to apply on commit.
0-Based depth of the current transaction. If 0 then it's globally available.
Describes the current transaction.
A unique id for this transaction. This will be the same id for all sub transactions.
The operation this transaction was begun for (ITransaction.StoreOperationOptions.operation),
or null when it was begun without one.
If root transaction will return self.
Identifies what a rollback of this transaction undoes on its own.
A root's is its id. A nested transaction has one of its own, unless it was begun as a step of the one it is nested in (ITransaction.StoreOperationOptions.savepoint). It is the key for a copy-on-write structure that is changed in place: a copy taken under one savepoint is not reachable from a state that outlives that savepoint's rollback.
Returns the state associated to a record for the current transaction or globally if there are no open transactions.
The store-issued record id (ITransaction.IStore.create).
All states in the current transaction, keyed by stateId.
Discard all changes and children transaction changes.
Records an intent on the root of this transaction: something to do once the operation completes, rather than a change to the state.
An intent is data - coords, ids and strings, never a model or a view. It is recorded on the root, so every nested transaction of an operation writes the same bag and a batch of N operations resolves one set of intents rather than N. It travels on the commit (ICommit.getIntents) and so is available again on undo and redo.
The store gives a key no meaning and no merge rule beyond last-write-wins. An intent that accumulates - a union of ranges, say - passes a function and merges its own way. The write is kept, so an amend replays it onto the commit it folds into: the accumulating writer runs a second time, handed the TARGET's value, and the union spans both. What this transaction itself holds under the key stays its own contribution, which is what it announces. A writer must therefore produce a new value rather than mutate the one it is handed.
Update the state for a record.
The store-issued record id (ITransaction.IStore.create).
A partial to merge, or a function of the previous state. Returning the previous state unchanged records nothing (a batch of such calls elides).
Objects that implement this interface have ACID properties.