Class TrieSearchQuery<T>
Type Parameters
Hierarchy
- DynArrayReducer<T>
- TrieSearchQuery (view full)
Index
Constructors
Accessors
Methods
Constructors
constructor
- new
Trie <T>(trieSearch, options?): TrieSearchQuery<T>Search Query Type Parameters
Parameters
- trieSearch: TrieSearch<T>
The associated TrieSearch instance.
Optional
options: TrieSearchQueryOptions<T>Optional query settings.
Returns TrieSearchQuery<T>
- trieSearch: TrieSearch<T>
Accessors
data
- get data(): T[]
Returns the internal data of this instance. Be careful!
Note: if an array is set as initial data then that array is used as the internal data. If any changes are performed to the data externally do invoke
update
via DynArrayReducer.index withtrue
to recalculate the index and notify all subscribers.Returns T[]
The internal data.
derived
- get derived(): DynDerivedAPI<T[], number, T>
Returns DynDerivedAPI<T[], number, T>
Derived public API.
destroyed
- get destroyed(): boolean
Returns boolean
Returns whether this instance is destroyed.
filters
- get filters(): DynAdapterFilters<T>
Returns DynAdapterFilters<T>
The filters adapter.
index
- get index(): DynIndexerAPI<number, T>
Returns DynIndexerAPI<number, T>
Returns the Indexer public API.
isDestroyed
- get isDestroyed(): boolean
Returns boolean
The current destroyed state of this query instance.
length
- get length(): number
Gets the main data / items length.
Returns number
Main data / items length.
limit
query
reversed
- get reversed(): boolean
Gets current reversed state.
Returns boolean
Reversed state.
- set reversed(reversed): void
Sets reversed state and notifies subscribers.
Parameters
- reversed: boolean
New reversed state.
Returns void
- reversed: boolean
sort
- get sort(): DynAdapterSort<T>
Returns DynAdapterSort<T>
The sort adapter.
trieReducer
- get trieReducer(): TrieSearchReducer<T>
Returns TrieSearchReducer<T>
Any associated TrieSearch reducer function.
- set trieReducer(trieReducer): void
Parameters
- trieReducer: TrieSearchReducer<T>
A new trie reducer function.
Returns void
- trieReducer: TrieSearchReducer<T>
trieSearch
- get trieSearch(): TrieSearch<T>
Returns TrieSearch<T>
The associated TrieSearch instance; can be undefined.
Methods
[iterator]
- [iterator](): IterableIterator<T, any, any>
Provides an iterator for data stored in DynArrayReducer.
Returns IterableIterator<T, any, any>
Iterator for data stored in DynArrayReducer.
destroy
Protected
initialize
setData
subscribe
- subscribe(handler): (() => void)
Add a subscriber to this DynArrayReducer instance.
Parameters
- handler: ((value: DynArrayReducer<T>) => void)
Callback function that is invoked on update / changes. Receives
this
reference.- (value): void
Parameters
- value: DynArrayReducer<T>
Returns void
Returns (() => void)
Unsubscribe function.
- (): void
Returns void
- handler: ((value: DynArrayReducer<T>) => void)
Provides a reactive query interface to TrieSearch in addition to dynamic filtering / sorting of search results.