ViewModelCache
Sourceimport  { ViewModelCache } from "@prestojs/viewmodel";
ViewModelCache<ViewModelClassType>
Constructor
Methods
Returns:T[]
Returns:PartialViewModel[]
Returns:ChangeListenerUnsubscribe
Arguments:
| Argument | Type | Description | |
|---|---|---|---|
| * | pkOrPks | Object|mapped | |
| * | fieldNames | T[] | |
| * | listener | ChangeListener | |
| batch | boolean | 
Returns:ChangeListenerUnsubscribe
Arguments:
| Argument | Type | Description | |
|---|---|---|---|
| * | pkOrPks | Object|mapped | |
| * | fieldNames | "*" | |
| * | listener | ChangeListener | |
| batch | boolean | 
Returns:ChangeListenerUnsubscribe
Arguments:
| Argument | Type | Description | |
|---|---|---|---|
| * | pkOrPks | (Object|mapped)[] | |
| * | fieldNames | T[] | |
| * | listener | MultiChangeListener | |
| batch | boolean | 
Returns:ChangeListenerUnsubscribe
Arguments:
| Argument | Type | Description | |
|---|---|---|---|
| * | pkOrPksOrListener | (Object|mapped)[] | |
| * | fieldNames | "*" | |
| * | listener | MultiChangeListener | |
| batch | boolean | 
Returns:ChangeListenerUnsubscribe
Returns:ChangeListenerUnsubscribe
Returns:ChangeListenerUnsubscribe
Returns:boolean
Arguments:
| Argument | Type | Description | |
|---|---|---|---|
| * | record | PartialViewModel | 
Returns:PartialViewModel[]
Returns:PartialViewModel[]
Returns:T[]|(null|T)[]
Arguments:
| Argument | Type | Description | |
|---|---|---|---|
| * | records | PartialViewModel[] | |
| removeNulls | RemoveNullsT | 
Properties
cache
SourceviewModel
SourceStatic Properties
listenerBatcher
Source| An object with these properties: | |||
|---|---|---|---|
| Property | Type | Description | |
| * | batch | ||
| * | call | ||
| * | callAll | ||
| isActive | boolean | ||
| pending | |||
| pendingAll | Set | ||
| pendingNoBatch | |||