-
Notifications
You must be signed in to change notification settings - Fork 1
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
62e7550
commit 922289f
Showing
27 changed files
with
123 additions
and
100 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
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
Empty file.
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,4 +1,8 @@ | ||
// Stores | ||
export * from './status'; | ||
export * from './loadingState'; | ||
export * from './marcPreview'; | ||
export * from './profile'; | ||
|
||
// Selector hooks | ||
export * from './selectors'; |
Empty file.
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { StateCreator } from 'zustand'; | ||
import { createBaseSlice, SliceState } from './utils/slice'; | ||
import { generateStore } from './utils/storeCreator'; | ||
|
||
type SelectedProfileType = ProfileEntry | null; | ||
type PreparedFieldsType = ResourceTemplates | null; | ||
type InitialSchemaKeyType = string | null; | ||
|
||
export type ProfileState = SliceState<'profiles', ProfileEntry[]> & | ||
SliceState<'selectedProfile', SelectedProfileType> & | ||
SliceState<'preparedFields', PreparedFieldsType> & | ||
SliceState<'initialSchemaKey', InitialSchemaKeyType> & | ||
SliceState<'schema', Map<string, SchemaEntry>>; | ||
|
||
const STORE_NAME = 'Profile'; | ||
|
||
const profileStore: StateCreator<ProfileState, [['zustand/devtools', never]], []> = (...args) => ({ | ||
...createBaseSlice({ basic: 'profiles' }, [] as ProfileEntry[])(...args), | ||
...createBaseSlice({ basic: 'selectedProfile' }, null as SelectedProfileType)(...args), | ||
...createBaseSlice({ basic: 'preparedFields' }, null as PreparedFieldsType)(...args), | ||
...createBaseSlice({ basic: 'initialSchemaKey' }, null as InitialSchemaKeyType)(...args), | ||
...createBaseSlice({ basic: 'schema' }, new Map())(...args), | ||
}); | ||
|
||
export const useProfileStore = generateStore(profileStore, STORE_NAME); |
Empty file.
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
Empty file.
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
Oops, something went wrong.