API
dynamicQueryState
A useQueryStates entry whose keys come from runtime definitions.
Hover the name for its full signature.
import { dynamicQueryState } from '@chronicstone/vue-route-query'
Options
| Option | Type | Description |
|---|---|---|
urlPrefix | string | Prefix for every key this entry owns, after the group prefix. |
definitions | () => TDefinition[] | The definitions that exist when the group reads or writes. |
resolve | (definition) => { urlKey: string; codec }[] | Every key one definition may use, with its codec. The codec's rules apply; its default and write options are not used. |
parse | (entries: ReadonlyMap<string, unknown>, definitions) => TValue | Builds the value from the accepted entries. Rejected entries are left out and reported in issues. |
serialize | (value, definitions) => Map<string, unknown> | Maps the value back to entries. Keys left out are removed. |
default | TValue | The value when no accepted key is present. |
Returns
A schema entry for useQueryStates. It is not reactive by itself. See Dynamic keys for a full example.