useObject404
Overview
A composable function for handling a 404 error on an ObjectInstance, given the props and model config, and updating a passed error ref.
Signature
useObject404(yourProps, yourInstanceObject, yourModelConfig, yourErrorRef)
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| yourProps | object | yes | The props object. |
| yourInstanceObject | ObjectInstance | yes | The object instance. |
| yourModelConfig | object | yes | The model config. |
| yourErrorRef | Ref | yes | The error ref. |
yourProps Properties
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| pk | string |
yourModelConfig Properties
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| app | string | The app name being used. | ||
| clearError | () => void | Clear the error. | ||
| config | object | The model config. | ||
| effectScope | object | The effect scope for the instance. | ||
| error | Error | The error that occurred while loading the model config. | ||
| errored | boolean | True if an error occurred while loading the model config. | ||
| info | object | The model info. | ||
| loading | boolean | True if the model config is loading. | ||
| model | string | The model name being used. | ||
| view | string | The view being used, if any. |
Returns
void
Source
client/lib/use/useObject404.js:21