@rotorsoft/act 0.17.1 → 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/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
- state2 = patch(state2, me.patch[event.name](event, state2));
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);