Skip to content

Commit

Permalink
馃悰 fix: compatible with zustand v4.4 usage
Browse files Browse the repository at this point in the history
  • Loading branch information
arvinxx committed Aug 7, 2023
1 parent c2b5669 commit b4e0e3e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions package.json
Expand Up @@ -77,8 +77,8 @@
"reactflow": "^11",
"use-merge-value": "^1",
"yjs": "^13",
"zustand": "^4",
"zustand-utils": "^1"
"zustand": "^4.4.1",
"zustand-utils": "^1.3.1"
},
"devDependencies": {
"@commitlint/cli": "^17",
Expand Down
8 changes: 6 additions & 2 deletions src/FlowEditor/store/index.ts
@@ -1,4 +1,7 @@
import { create, StoreApi } from 'zustand';
import { StoreApi } from 'zustand';
import { shallow } from 'zustand/shallow';
import { createWithEqualityFn } from 'zustand/traditional';

import { createContext, optionalDevtools } from 'zustand-utils';

import { InternalFlow } from '../types';
Expand All @@ -8,8 +11,9 @@ import { createStore, FlowEditorStore } from './actions';
export const createFlowEditorStore = (showDevtools = false) => {
const doc = new DocWithHistoryManager<InternalFlow>();

return create<FlowEditorStore>()(
return createWithEqualityFn<FlowEditorStore>()(
optionalDevtools(showDevtools)(createStore(doc), { name: 'FLOW_EDITOR' }),
shallow,
);
};

Expand Down

0 comments on commit b4e0e3e

Please sign in to comment.