Skip to content

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

NameTypeRequiredDescription
modelConfigobjectyesAn existing model config instance.
propsUseFilterablesOverridesyesOverrides for the model config's declared filterables/details.
stateobjectnoTarget 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

NameTypeRequiredDefaultDescription
appstringThe app name being used.
clearError() => voidClear the error.
configobjectThe model config.
effectScopeobjectThe effect scope for the instance.
errorErrorThe error that occurred while loading the model config.
erroredbooleanTrue if an error occurred while loading the model config.
infoobjectThe model info.
loadingbooleanTrue if the model config is loading.
modelstringThe model name being used.
viewstringThe view being used, if any.

state Properties

NameTypeRequiredDefaultDescription
filterableDetailsobjectThe merged filterableDetails, either passed in, from config or from server info.
filterablesstring[]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

Documents matching: server v3.0.0a1.post1client v3.0.0-alpha.2