Lil' Saga
lil-saga
is a small library to assist in use of the saga pattern.
Usage
lil-saga
accepts a generator which may yield a Saga
, a Promise
, or an array containing a mix of Saga
s and Promise
s.
If an array is yielded, the actions (and any subsequent rollbacks), will be performed concurrently.
If an error occurs during execution, any previously executed Saga
s will have their undo
performed, in reverse order of execution.
Example
; await ;