Add global variables store using Zustand
This commit is contained in:
parent
0a0f35cdac
commit
c1d9e12956
2 changed files with 13 additions and 0 deletions
9
src/frontend/src/stores/globalVariables.ts
Normal file
9
src/frontend/src/stores/globalVariables.ts
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
import { create } from "zustand";
|
||||
import { GlobalVariablesStore } from "../types/zustand/globalVariables";
|
||||
|
||||
const useGlobalVariablesStore = create<GlobalVariablesStore>((set, get) => ({
|
||||
globalVariables: [],
|
||||
setGlobalVariables: (variables) => {
|
||||
set({ globalVariables: variables });
|
||||
},
|
||||
}));
|
||||
4
src/frontend/src/types/zustand/globalVariables/index.ts
Normal file
4
src/frontend/src/types/zustand/globalVariables/index.ts
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
export type GlobalVariablesStore = {
|
||||
globalVariables: Array<string>;
|
||||
setGlobalVariables: (variables: Array<string>) => void;
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue