refactor(state): replace redux with zustand

This commit is contained in:
moklick
2021-10-13 12:54:01 +02:00
parent e01249a87c
commit ee0d29029a
38 changed files with 786 additions and 896 deletions
+5 -2
View File
@@ -1,10 +1,13 @@
import { useEffect, MutableRefObject } from 'react';
import { useStoreActions } from '../store/hooks';
import { useStore } from '../store';
import { getDimensions } from '../utils';
import { ReactFlowState } from '../types';
const updateSizeSelector = (state: ReactFlowState) => state.updateSize;
export default (rendererNode: MutableRefObject<HTMLDivElement | null>) => {
const updateSize = useStoreActions((actions) => actions.updateSize);
const updateSize = useStore(updateSizeSelector);
useEffect(() => {
let resizeObserver: ResizeObserver;