useFilterables
Overview
Merges a model config's declared filterable field list and per-field details with caller-supplied overrides (props take priority). Standalone so a caller that only needs the resolved filterable field set — not field/widget component resolution or the FilterModelSymbol provide that useFilter also does — can reuse an existing useModelConfig instance instead of creating a second one.
Signature
useFilterables(modelConfig, props, state)
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| modelConfig | object | yes | An existing model config instance. |
| props | UseFilterablesOverrides | yes | Overrides for the model config's declared filterables/details. |
| state | object | no | Target object to write filterables/filterableDetails into. Pass a caller-owned object (e.g. one already consumed by a downstream deep watch) to write in place, rather than bridging through a second wrapped object. Defaults to a fresh one. |
modelConfig 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. |
state Properties
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| filterableDetails | object | The merged filterableDetails, either passed in, from config or from server info. | ||
| filterables | string[] | The filters to display, either passed in or from config. |
Returns
The merged, reactive filterable field list and details.
Source
client/lib/use/useFilterables.js:38