Skip to content

Commit

Permalink
fix reduxDevTool serialization
Browse files Browse the repository at this point in the history
  • Loading branch information
MrWangJustToDo committed Nov 15, 2023
1 parent 8632445 commit 3cea285
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/r-store/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ export declare type UseSelectorWithStore<T> = {
/**
* @public
*/
export declare const version = "0.2.6";
export declare const version = "0.2.7";

/**
* @public
Expand Down
2 changes: 1 addition & 1 deletion packages/r-store/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "reactivity-store",
"version": "0.2.6",
"version": "0.2.7",
"author": "MrWangJustToDo",
"license": "MIT",
"description": "a reactive store, make you write reactive logic in react app just like zustand",
Expand Down
4 changes: 3 additions & 1 deletion packages/r-store/src/shared/dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,11 @@ export const connectDevTool = (name: string, actions: Record<string, Function>,
p[c] = (...args) => {
const re = actions[c](...args);
try {
const len = actions[c].length || 0;

const nextObj = { ...devToolMap, [name]: JSON.parse(JSON.stringify(state)) };

devTools.send({ ...action, $payload: args }, nextObj);
devTools.send({ ...action, $payload: args.slice(0, len) }, nextObj);
} catch (e) {
console.log(e);

Expand Down

0 comments on commit 3cea285

Please sign in to comment.