()
| 89 | } |
| 90 | |
| 91 | function useUserDispatch() { |
| 92 | let context = React.useContext(UserDispatchContext); |
| 93 | if (context === undefined) { |
| 94 | throw new Error('useUserDispatch must be used within a UserProvider'); |
| 95 | } |
| 96 | return context; |
| 97 | } |
| 98 | |
| 99 | export { UserProvider, useUserState, useUserDispatch, loginUser, signOut }; |
| 100 |