-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9eaf316
commit 4d11ced
Showing
6 changed files
with
14 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
import { create, StateCreator } from 'zustand'; | ||
import { create, type StateCreator } from 'zustand'; | ||
import { devtools } from 'zustand/middleware'; | ||
import { IS_PROD_MODE } from '@common/constants/bundle.constants'; | ||
|
||
const STORE_NAME = 'Linked Data Editor'; | ||
|
||
export const generateStore = <T>(store: StateCreator<T, [['zustand/devtools', never]], []>, name: string) => | ||
export type StateCreatorTyped<T> = StateCreator<T, [['zustand/devtools', never]], []>; | ||
|
||
export const generateStore = <T>(store: StateCreatorTyped<T>, name: string) => | ||
create<T>()(devtools(store, { name: STORE_NAME, store: name, enabled: !IS_PROD_MODE })); |