diff options
author | 2021-08-22 21:35:53 +0200 | |
---|---|---|
committer | 2021-08-22 21:36:34 +0200 | |
commit | c644cb26384cd126a1e71ce652b358e0a87e3b59 (patch) | |
tree | 19f29cb466098af0cbb742cb18a88d2a632643ec /language-web/src/main/js/RootStore.tsx | |
parent | Covert language-web to TypeScript (diff) | |
download | refinery-c644cb26384cd126a1e71ce652b358e0a87e3b59.tar.gz refinery-c644cb26384cd126a1e71ce652b358e0a87e3b59.tar.zst refinery-c644cb26384cd126a1e71ce652b358e0a87e3b59.zip |
Add ESLint config
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'); |