()
| 444 | |
| 445 | /** Preffered way of using the store in a Component or Hook */ |
| 446 | export function useStore(): Store { |
| 447 | const store = React.useContext(StoreContext); |
| 448 | |
| 449 | if (store == undefined) { |
| 450 | throw new Error( |
| 451 | 'Store is not found in react context. Have you wrapped your application in `<StoreContext.Provider value={new Store}>`?', |
| 452 | ); |
| 453 | } |
| 454 | return store; |
| 455 | } |
| 456 | |
| 457 | /** |
| 458 | * Checks if the Agent has the appropriate rights to edit this resource. If you |
no outgoing calls
no test coverage detected