diff options
Diffstat (limited to 'language-web/src/main/js/RootStore.tsx')
-rw-r--r-- | language-web/src/main/js/RootStore.tsx | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/language-web/src/main/js/RootStore.tsx b/language-web/src/main/js/RootStore.tsx index 2159f440..1c3aab2b 100644 --- a/language-web/src/main/js/RootStore.tsx +++ b/language-web/src/main/js/RootStore.tsx | |||
@@ -1,9 +1,8 @@ | |||
1 | |||
2 | import React, { createContext, useContext } from 'react'; | 1 | import React, { createContext, useContext } from 'react'; |
3 | 2 | ||
4 | import EditorStore from './editor/EditorStore'; | 3 | import { EditorStore } from './editor/EditorStore'; |
5 | 4 | ||
6 | export default class RootStore { | 5 | export class RootStore { |
7 | editorStore; | 6 | editorStore; |
8 | 7 | ||
9 | constructor() { | 8 | constructor() { |
@@ -19,7 +18,7 @@ export const RootStoreProvider: React.FC<{ rootStore: RootStore }> = ({ children | |||
19 | </StoreContext.Provider> | 18 | </StoreContext.Provider> |
20 | ); | 19 | ); |
21 | 20 | ||
22 | export const useRootStore = () => { | 21 | export const useRootStore = (): RootStore => { |
23 | const rootStore = useContext(StoreContext); | 22 | const rootStore = useContext(StoreContext); |
24 | if (!rootStore) { | 23 | if (!rootStore) { |
25 | throw new Error('useRootStore must be used within RootStoreProvider'); | 24 | throw new Error('useRootStore must be used within RootStoreProvider'); |