diff --git a/src/store/TriggersLocalStore.ts b/src/store/TriggersLocalStore.ts index 82bdac4bb..ab0ab1f51 100644 --- a/src/store/TriggersLocalStore.ts +++ b/src/store/TriggersLocalStore.ts @@ -1,25 +1,27 @@ -import {useRef} from "react"; +import {useRef} from 'react'; + import {create} from 'zustand'; import {devtools} from 'zustand/middleware'; import {shallow} from 'zustand/shallow'; + import createTriggersSlice, {TriggersSlice} from './TriggersSlice'; const useTriggersLocalStore = () => { - const useStoreRef = useRef( - create()( - devtools( - (...a) => ({ - ...createTriggersSlice(...a), - }), - {name: 'Triggers Local Store Zustand', enabled: process.env.NODE_ENV === 'development'} - ) - ) - ); - const useStore = useStoreRef.current; - - const useShallowLocalStore = (selector: (state: TriggersSlice) => U) => useStore(selector, shallow); + const useStoreRef = useRef( + create()( + devtools( + (...a) => ({ + ...createTriggersSlice(...a), + }), + {name: 'Triggers Local Store Zustand', enabled: process.env.NODE_ENV === 'development'} + ) + ) + ); + const useStore = useStoreRef.current; + + const useShallowLocalStore = (selector: (state: TriggersSlice) => U) => useStore(selector, shallow); - return [useShallowLocalStore]; -}; + return [useShallowLocalStore]; +}; export default useTriggersLocalStore;