()
| 102 | } |
| 103 | |
| 104 | function useAppStore(): AppStateStore { |
| 105 | // eslint-disable-next-line react-hooks/rules-of-hooks |
| 106 | const store = useContext(AppStoreContext); |
| 107 | if (!store) { |
| 108 | throw new ReferenceError('useAppState/useSetAppState cannot be called outside of an <AppStateProvider />'); |
| 109 | } |
| 110 | return store; |
| 111 | } |
| 112 | |
| 113 | /** |
| 114 | * Subscribe to a slice of AppState. Only re-renders when the selected value |
no outgoing calls
no test coverage detected