-
-
Save reime005/03e8316ade92ddbe6dc278112cca440e 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
// config.ts | |
export const setupStore = async (): Promise<Store> => { | |
// we could perform asynchronously loading operations here | |
return initialStore; | |
}; | |
const RootStoreContext = React.createContext<Store>(initialStore); | |
/** | |
* The provider to expose the root store | |
*/ | |
export const RootStoreProvider = RootStoreContext.Provider; | |
export const useConfig = () => React.useContext(RootStoreContext).config; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment