Function: transactionMiddleware()
function transactionMiddleware<M>(target): ActionMiddlewareDisposer;
Creates a transaction middleware, which reverts changes made by an action / child actions when the root action throws an exception, restoring the values those changes replaced.
Type Parameters
| Type Parameter | Description |
|---|---|
M extends AnyModel | Model |
Parameters
| Parameter | Type | Description |
|---|---|---|
target | { actionName: keyof M; model: M; } | Object with the root target model object (model) and root action name (actionName). |
target.actionName | keyof M | - |
target.model | M | - |
Returns
The middleware disposer.