Skip to content

Commit

Permalink
prettier fix
Browse files Browse the repository at this point in the history
  • Loading branch information
pavloburchak committed May 30, 2023
1 parent 70336f1 commit 111921d
Showing 1 changed file with 18 additions and 16 deletions.
34 changes: 18 additions & 16 deletions src/store/TriggersLocalStore.ts
Original file line number Diff line number Diff line change
@@ -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<TriggersSlice>()(
devtools(
(...a) => ({
...createTriggersSlice(...a),
}),
{name: 'Triggers Local Store Zustand', enabled: process.env.NODE_ENV === 'development'}
)
)
);
const useStore = useStoreRef.current;
const useShallowLocalStore = <U>(selector: (state: TriggersSlice) => U) => useStore(selector, shallow);
const useStoreRef = useRef(
create<TriggersSlice>()(
devtools(
(...a) => ({
...createTriggersSlice(...a),
}),
{name: 'Triggers Local Store Zustand', enabled: process.env.NODE_ENV === 'development'}
)
)
);
const useStore = useStoreRef.current;

const useShallowLocalStore = <U>(selector: (state: TriggersSlice) => U) => useStore(selector, shallow);

return [useShallowLocalStore];
};
return [useShallowLocalStore];
};

export default useTriggersLocalStore;

0 comments on commit 111921d

Please sign in to comment.