@rotorsoft/act 0.17.0 → 0.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.tsbuildinfo +1 -1
- package/dist/@types/event-sourcing.d.ts.map +1 -1
- package/dist/@types/types/action.d.ts +2 -0
- package/dist/@types/types/action.d.ts.map +1 -1
- package/dist/index.cjs +3 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -673,9 +673,10 @@ async function action(me, action2, target, payload, reactingTo, skipValidation =
|
|
|
673
673
|
);
|
|
674
674
|
let { state: state2, patches } = snapshot;
|
|
675
675
|
const snapshots = committed.map((event) => {
|
|
676
|
-
|
|
676
|
+
const p = me.patch[event.name](event, state2);
|
|
677
|
+
state2 = patch(state2, p);
|
|
677
678
|
patches++;
|
|
678
|
-
return { event, state: state2, patches, snaps: snapshot.snaps };
|
|
679
|
+
return { event, state: state2, patches, snaps: snapshot.snaps, patch: p };
|
|
679
680
|
});
|
|
680
681
|
const last = snapshots.at(-1);
|
|
681
682
|
me.snap && me.snap(last) && void snap(last);
|