ViewModelCache
Sourceimport { ViewModelCache } from "@prestojs/viewmodel";
ViewModelCache<ViewModelClassType>
Constructor
Params:
Parameter | Type | Description | |
---|---|---|---|
* | viewModel | ViewModelClassType |
Methods
Params:
Parameter | Type | Description | |
---|---|---|---|
* | recordOrData | T |
Returns:T
Params:
Parameter | Type | Description | |
---|---|---|---|
* | recordOrData | T[] |
Returns:T[]
Params:
Parameter | Type | Description | |
---|---|---|---|
* | recordOrData | mapped |
Returns:PartialViewModel
Params:
Parameter | Type | Description | |
---|---|---|---|
* | recordOrData | mapped[] |
Returns:PartialViewModel[]
Params:
Parameter | Type | Description | |
---|---|---|---|
* | recordsOrData | T[] |
Returns:T[]
Params:
Parameter | Type | Description | |
---|---|---|---|
* | recordsOrData | mapped[] |
Returns:PartialViewModel[]
Params:
Parameter | Type | Description | |
---|---|---|---|
* | listener | AllChangesListener |
Returns:ChangeListenerUnsubscribe
Params:
Parameter | Type | Description | |
---|---|---|---|
* | pkOrPks | Object|mapped | |
* | fieldNames | T[] | |
* | listener | ChangeListener | |
batch | boolean |
Returns:ChangeListenerUnsubscribe
Params:
Parameter | Type | Description | |
---|---|---|---|
* | pkOrPks | Object|mapped | |
* | fieldNames | "*" | |
* | listener | ChangeListener | |
batch | boolean |
Returns:ChangeListenerUnsubscribe
Params:
Parameter | Type | Description | |
---|---|---|---|
* | pkOrPks | (Object|mapped)[] | |
* | fieldNames | T[] | |
* | listener | MultiChangeListener | |
batch | boolean |
Returns:ChangeListenerUnsubscribe
Params:
Parameter | Type | Description | |
---|---|---|---|
* | pkOrPksOrListener | (Object|mapped)[] | |
* | fieldNames | "*" | |
* | listener | MultiChangeListener | |
batch | boolean |
Returns:ChangeListenerUnsubscribe
Params:
Parameter | Type | Description | |
---|---|---|---|
* | pks | (Object|mapped)[] | |
* | fieldNames | T[] | |
* | listener | MultiChangeListener |
Returns:ChangeListenerUnsubscribe
Params:
Parameter | Type | Description | |
---|---|---|---|
* | pks | (Object|mapped)[] | |
* | fieldNames | "*" | |
* | listener | MultiChangeListener |
Returns:ChangeListenerUnsubscribe
Params:
Parameter | Type | Description | |
---|---|---|---|
* | pk | Object|mapped | |
fieldNames | '*'|[string|string[]][] |
Returns:boolean
Params:
Parameter | Type | Description | |
---|---|---|---|
* | pk | Object|mapped | |
* | fieldNames | T[] |
Params:
Parameter | Type | Description | |
---|---|---|---|
* | pk | Object|mapped | |
* | fieldNames | "*" |
Params:
Parameter | Type | Description | |
---|---|---|---|
* | record | PartialViewModel |
Params:
Parameter | Type | Description | |
---|---|---|---|
* | fieldNames | "*" |
Returns:PartialViewModel[]
Params:
Parameter | Type | Description | |
---|---|---|---|
* | fieldNames | T[] |
Returns:PartialViewModel[]
Params:
Parameter | Type | Description | |
---|---|---|---|
* | pks | (Object|mapped)[] | |
* | fieldNames | T[] | |
removeNulls | RemoveNullsT |
Params:
Parameter | Type | Description | |
---|---|---|---|
* | pks | (Object|mapped)[] | |
* | fieldNames | "*" | |
removeNulls | RemoveNullsT |
Params:
Parameter | Type | Description | |
---|---|---|---|
* | records | T[] | |
removeNulls | RemoveNullsT |
Returns:T[]|(null|T)[]
Params:
Parameter | Type | Description | |
---|---|---|---|
* | records | PartialViewModel[] | |
removeNulls | RemoveNullsT |
Properties
cache
SourceviewModel
SourceStatic Properties
listenerBatcher
SourceAn object with these properties: | |||
---|---|---|---|
Property | Type | Description | |
* | batch | ||
* | call | ||
* | callAll | ||
isActive | boolean | ||
pending | Map | ||
pendingAll | Set | ||
pendingNoBatch | Map |