Skip to content

API Documentation / @pinia/colada / UseQueryEntryFilter

Interface: UseQueryEntryFilter

Filter to get entries from the cache.

Properties

active?

ts
optional active: null | boolean;

If true or false, it will only return entries that match the active status. If set to null or undefined, it matches both.


exact?

ts
optional exact: boolean;

If true, it will only match the exact key, not the children.

Example

ts
{ key: ['a'], exact: true }
 // will match ['a'] but not ['a', 'b'], while
{ key: ['a'] }
// will match both

key?

ts
optional key: readonly (EntryNodeKey | _ObjectFlat)[];

A key to filter the entries.


predicate()?

ts
optional predicate: (entry) => boolean;

Pass a predicate to filter the entries. This will be executed for each entry matching the other filters.

Parameters

entry

UseQueryEntry

entry to filter

Returns

boolean


stale?

ts
optional stale: null | boolean;

If true or false, it will only return entries that match the stale status. If set to null or undefined, it matches both. Requires entry.options to be set.


status?

ts
optional status: null | DataStateStatus;

If it has a non nullish value, it only returns the entries with the given status.

Released under the MIT License.