Created
January 13, 2020 23:42
-
-
Save bernatfortet/f700dfa26b96e10ef6f004f5f941add7 to your computer and use it in GitHub Desktop.
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
import create, { GetFunction, SetFunction } from 'zustand' | |
export type MyStore = { | |
flag?: boolean | |
actions: MyActions | |
} | |
class MyActions { | |
constructor(public set: SetFunction<MyStore>, public get: GetFunction<MyStore>) {} | |
action = async () => { | |
} | |
} | |
export const [useAdminStore, adminApi] = create<MyStore>((set, get) => ({ | |
flag: true, | |
actions: new MyActions(set, get) | |
})) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment