Skip to content

Commit a58697a

Browse files
committed
Update package version to 0.1.15 and enhance event handler interceptor to include reverse patches in trace merging, improving state management and debugging capabilities.
1 parent bb88419 commit a58697a

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@flexsurfer/reflex",
3-
"version": "0.1.14",
3+
"version": "0.1.15",
44
"license": "MIT",
55
"repository": {
66
"type": "git",

src/events.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { doFxInterceptor } from './fx';
77
import type { Draft } from 'immer';
88
import { enablePatches, produceWithPatches } from 'immer';
99
import { getAppDb } from './db';
10-
import {getGlobalInterceptors} from './settings';
10+
import { getGlobalInterceptors } from './settings';
1111
import { mergeTrace, withTrace } from './trace';
1212
import { IS_DEV } from './env';
1313

@@ -98,7 +98,7 @@ function eventHandlerInterceptor(handler: EventHandler): Interceptor {
9898
const params = event.slice(1); // Extract parameters excluding the event ID
9999

100100
let effects: Effects = [];
101-
const [newDb, patches] = produceWithPatches(getAppDb(),
101+
const [newDb, patches, reversePatches] = produceWithPatches(getAppDb(),
102102
(draftDb: Draft<Db>) => {
103103
const coeffectsWithDb = { ...context.coeffects, draftDb };
104104
effects = handler(coeffectsWithDb, ...params) || [];
@@ -115,7 +115,7 @@ function eventHandlerInterceptor(handler: EventHandler): Interceptor {
115115
context.newDb = newDb;
116116
context.patches = patches;
117117

118-
mergeTrace({ tags: { 'patches': patches , 'effects': effects}});
118+
mergeTrace({ tags: { 'patches': patches, 'reversePatches': reversePatches, 'effects': effects } });
119119

120120
if (!Array.isArray(effects)) {
121121
consoleLog('warn', `[reflex] effects expects a vector, but was given ${typeof effects}`);

0 commit comments

Comments
 (0)