Class: AsyncRecordCache<QO, TO, QB, TB, QueryResponseDetails, TransformResponseDetails>
Type parameters​
Name | Type |
---|---|
QO | extends RequestOptions = RecordCacheQueryOptions |
TO | extends RequestOptions = RecordCacheTransformOptions |
QB | RecordQueryBuilder |
TB | RecordTransformBuilder |
QueryResponseDetails | unknown |
TransformResponseDetails | extends RecordCacheUpdateDetails = RecordCacheUpdateDetails |
Hierarchy​
RecordCache
<QO
,TO
,QB
,TB
>↳
AsyncRecordCache
Implements​
AsyncRecordAccessor
AsyncRecordQueryable
<QueryResponseDetails
,QB
,QO
>AsyncRecordUpdatable
<TransformResponseDetails
,TB
,TO
>
Constructors​
constructor​
• new AsyncRecordCache<QO
, TO
, QB
, TB
, QueryResponseDetails
, TransformResponseDetails
>(settings
)
Type parameters​
Name | Type |
---|---|
QO | extends RequestOptions = RecordCacheQueryOptions |
TO | extends RequestOptions = RecordCacheTransformOptions |
QB | RecordQueryBuilder <string , RecordIdentity > |
TB | RecordTransformBuilder <string , RecordIdentity , UninitializedRecord > |
QueryResponseDetails | unknown |
TransformResponseDetails | extends RecordCacheUpdateDetails = RecordCacheUpdateDetails |
Parameters​
Name | Type |
---|---|
settings | AsyncRecordCacheSettings <QO , TO , QB , TB > |
Overrides​
Defined in​
record-cache/src/async-record-cache.ts:102
Accessors​
defaultQueryOptions​
• get
defaultQueryOptions(): undefined
| DefaultRequestOptions
<QueryOptions
>
Returns​
undefined
| DefaultRequestOptions
<QueryOptions
>
Inherited from​
RecordCache.defaultQueryOptions
Defined in​
record-cache/src/record-cache.ts:187
• set
defaultQueryOptions(options
): void
Parameters​
Name | Type |
---|---|
options | undefined | DefaultRequestOptions <QueryOptions > |
Returns​
void
Inherited from​
RecordCache.defaultQueryOptions
Defined in​
record-cache/src/record-cache.ts:191
defaultTransformOptions​
• get
defaultTransformOptions(): undefined
| DefaultRequestOptions
<TransformOptions
>
Returns​
undefined
| DefaultRequestOptions
<TransformOptions
>
Inherited from​
RecordCache.defaultTransformOptions
Defined in​
record-cache/src/record-cache.ts:197
• set
defaultTransformOptions(options
): void
Parameters​
Name | Type |
---|---|
options | undefined | DefaultRequestOptions <TransformOptions > |
Returns​
void
Inherited from​
RecordCache.defaultTransformOptions
Defined in​
record-cache/src/record-cache.ts:203
keyMap​
• get
keyMap(): undefined
| RecordKeyMap
Returns​
undefined
| RecordKeyMap
Implementation of​
Inherited from​
RecordCache.keyMap
Defined in​
record-cache/src/record-cache.ts:169
name​
• get
name(): undefined
| string
Returns​
undefined
| string
Implementation of​
Inherited from​
RecordCache.name
Defined in​
record-cache/src/record-cache.ts:161
processors​
• get
processors(): AsyncOperationProcessor
[]
Returns​
Defined in​
record-cache/src/async-record-cache.ts:131
queryBuilder​
• get
queryBuilder(): QueryBuilder
Returns​
QueryBuilder
Inherited from​
RecordCache.queryBuilder
Defined in​
record-cache/src/record-cache.ts:179
schema​
• get
schema(): RecordSchema
Returns​
RecordSchema
Implementation of​
Inherited from​
RecordCache.schema
Defined in​
record-cache/src/record-cache.ts:165
transformBuilder​
• get
transformBuilder(): TransformBuilder
Returns​
TransformBuilder
Inherited from​
RecordCache.transformBuilder
Defined in​
record-cache/src/record-cache.ts:183
validatorFor​
• get
validatorFor(): undefined
| ValidatorForFn
<StandardValidator
| StandardRecordValidator
>
Returns​
undefined
| ValidatorForFn
<StandardValidator
| StandardRecordValidator
>
Inherited from​
RecordCache.validatorFor
Defined in​
record-cache/src/record-cache.ts:173
Methods​
addInverseRelationshipsAsync​
â–¸ Abstract
addInverseRelationshipsAsync(relationships
): Promise
<void
>
Parameters​
Name | Type |
---|---|
relationships | RecordRelationshipIdentity [] |
Returns​
Promise
<void
>
Implementation of​
AsyncRecordAccessor.addInverseRelationshipsAsync
Defined in​
record-cache/src/async-record-cache.ts:167
applyRecordChangesetAsync​
â–¸ applyRecordChangesetAsync(changeset
): Promise
<void
>
Parameters​
Name | Type |
---|---|
changeset | RecordChangeset |
Returns​
Promise
<void
>
Implementation of​
AsyncRecordAccessor.applyRecordChangesetAsync
Defined in​
record-cache/src/async-record-cache.ts:174
emit​
â–¸ emit(event
, ...args
): void
Parameters​
Name | Type |
---|---|
event | Event |
...args | unknown [] |
Returns​
void
Inherited from​
Defined in​
core/dist/modules/evented.d.ts:23
getInverseRelationshipsAsync​
â–¸ Abstract
getInverseRelationshipsAsync(recordIdentityOrIdentities
): Promise
<RecordRelationshipIdentity
[]>
Parameters​
Name | Type |
---|---|
recordIdentityOrIdentities | RecordIdentity | RecordIdentity [] |
Returns​
Promise
<RecordRelationshipIdentity
[]>
Implementation of​
AsyncRecordAccessor.getInverseRelationshipsAsync
Defined in​
record-cache/src/async-record-cache.ts:154
getInverseTransformOperator​
â–¸ getInverseTransformOperator(op
): AsyncInverseTransformOperator
Parameters​
Name | Type |
---|---|
op | string |
Returns​
Defined in​
record-cache/src/async-record-cache.ts:143
getQueryOperator​
â–¸ getQueryOperator(op
): AsyncQueryOperator
Parameters​
Name | Type |
---|---|
op | string |
Returns​
Defined in​
record-cache/src/async-record-cache.ts:135
getQueryOptions​
â–¸ getQueryOptions(query
, expression?
): undefined
| QO
Parameters​
Name | Type |
---|---|
query | RecordQuery |
expression? | RecordQueryExpression |
Returns​
undefined
| QO
Inherited from​
Defined in​
record-cache/src/record-cache.ts:209
getRecordAsync​
â–¸ Abstract
getRecordAsync(recordIdentity
): Promise
<undefined
| InitializedRecord
>
Parameters​
Name | Type |
---|---|
recordIdentity | RecordIdentity |
Returns​
Promise
<undefined
| InitializedRecord
>
Implementation of​
AsyncRecordAccessor.getRecordAsync
Defined in​
record-cache/src/async-record-cache.ts:148
getRecordsAsync​
â–¸ Abstract
getRecordsAsync(typeOrIdentities?
): Promise
<InitializedRecord
[]>
Parameters​
Name | Type |
---|---|
typeOrIdentities? | string | RecordIdentity [] |
Returns​
Promise
<InitializedRecord
[]>
Implementation of​
AsyncRecordAccessor.getRecordsAsync
Defined in​
record-cache/src/async-record-cache.ts:151
getRelatedRecordAsync​
â–¸ getRelatedRecordAsync(identity
, relationship
): Promise
<undefined
| null
| RecordIdentity
>
Parameters​
Name | Type |
---|---|
identity | RecordIdentity |
relationship | string |
Returns​
Promise
<undefined
| null
| RecordIdentity
>
Implementation of​
AsyncRecordAccessor.getRelatedRecordAsync
Defined in​
record-cache/src/async-record-cache.ts:204
getRelatedRecordsAsync​
â–¸ getRelatedRecordsAsync(identity
, relationship
): Promise
<undefined
| RecordIdentity
[]>
Parameters​
Name | Type |
---|---|
identity | RecordIdentity |
relationship | string |
Returns​
Promise
<undefined
| RecordIdentity
[]>
Implementation of​
AsyncRecordAccessor.getRelatedRecordsAsync
Defined in​
record-cache/src/async-record-cache.ts:215
getTransformOperator​
â–¸ getTransformOperator(op
): AsyncTransformOperator
Parameters​
Name | Type |
---|---|
op | string |
Returns​
Defined in​
record-cache/src/async-record-cache.ts:139
getTransformOptions​
â–¸ getTransformOptions(transform
, operation?
): undefined
| TO
Parameters​
Name | Type |
---|---|
transform | RecordTransform |
operation? | RecordOperation |
Returns​
undefined
| TO
Inherited from​
RecordCache.getTransformOptions
Defined in​
record-cache/src/record-cache.ts:223
listeners​
â–¸ listeners(event
): Listener
[]
Parameters​
Name | Type |
---|---|
event | Event |
Returns​
Listener
[]
Inherited from​
Defined in​
core/dist/modules/evented.d.ts:24
liveQuery​
â–¸ liveQuery(queryOrExpressions
, options?
, id?
): AsyncLiveQuery
<QO
, TO
, QB
, TB
>
Parameters​
Name | Type |
---|---|
queryOrExpressions | QueryOrExpressions <RecordQueryExpression , QB > |
options? | DefaultRequestOptions <QO > |
id? | string |
Returns​
AsyncLiveQuery
<QO
, TO
, QB
, TB
>
Defined in​
record-cache/src/async-record-cache.ts:336
off​
â–¸ off(event
, listener?
): void
Parameters​
Name | Type |
---|---|
event | Event |
listener? | Listener |
Returns​
void
Inherited from​
Defined in​
core/dist/modules/evented.d.ts:21
on​
â–¸ on(event
, listener
): () => void
Parameters​
Name | Type |
---|---|
event | Event |
listener | Listener |
Returns​
fn
â–¸ (): void
Returns​
void
Inherited from​
Defined in​
core/dist/modules/evented.d.ts:20
one​
â–¸ one(event
, listener
): () => void
Parameters​
Name | Type |
---|---|
event | Event |
listener | Listener |
Returns​
fn
â–¸ (): void
Returns​
void
Inherited from​
Defined in​
core/dist/modules/evented.d.ts:22
patch​
â–¸ patch(operationOrOperations
): Promise
<PatchResult
>
Patches the cache with an operation or operations.
deprecated
since v0.17
Parameters​
Name | Type |
---|---|
operationOrOperations | RecordOperation | RecordOperation [] | RecordTransformBuilderFunc | RecordOperationTerm <string , RecordIdentity , UninitializedRecord > | RecordOperationTerm <string , RecordIdentity , UninitializedRecord >[] |
Returns​
Promise
<PatchResult
>
Defined in​
record-cache/src/async-record-cache.ts:309
query​
â–¸ query<RequestData
>(queryOrExpressions
, options?
, id?
): Promise
<RequestData
>
Queries the cache.
Type parameters​
Name | Type |
---|---|
RequestData | extends RecordQueryResult <InitializedRecord > = RecordQueryResult <InitializedRecord > |
Parameters​
Name | Type |
---|---|
queryOrExpressions | QueryOrExpressions <RecordQueryExpression , QB > |
options? | DefaultRequestOptions <QO > |
id? | string |
Returns​
Promise
<RequestData
>
Implementation of​
AsyncRecordQueryable.query
Defined in​
record-cache/src/async-record-cache.ts:229
â–¸ query<RequestData
>(queryOrExpressions
, options
, id?
): Promise
<FullResponse
<RequestData
, QueryResponseDetails
, RecordOperation
>>
Type parameters​
Name | Type |
---|---|
RequestData | extends RecordQueryResult <InitializedRecord > = RecordQueryResult <InitializedRecord > |
Parameters​
Name | Type |
---|---|
queryOrExpressions | QueryOrExpressions <RecordQueryExpression , QB > |
options | FullRequestOptions <QO > |
id? | string |
Returns​
Promise
<FullResponse
<RequestData
, QueryResponseDetails
, RecordOperation
>>
Implementation of​
AsyncRecordQueryable.query
Defined in​
record-cache/src/async-record-cache.ts:234
removeInverseRelationshipsAsync​
â–¸ Abstract
removeInverseRelationshipsAsync(relationships
): Promise
<void
>
Parameters​
Name | Type |
---|---|
relationships | RecordRelationshipIdentity [] |
Returns​
Promise
<void
>
Implementation of​
AsyncRecordAccessor.removeInverseRelationshipsAsync
Defined in​
record-cache/src/async-record-cache.ts:170
removeRecordAsync​
â–¸ Abstract
removeRecordAsync(recordIdentity
): Promise
<undefined
| InitializedRecord
>
Parameters​
Name | Type |
---|---|
recordIdentity | RecordIdentity |
Returns​
Promise
<undefined
| InitializedRecord
>
Implementation of​
AsyncRecordAccessor.removeRecordAsync
Defined in​
record-cache/src/async-record-cache.ts:161
removeRecordsAsync​
â–¸ Abstract
removeRecordsAsync(recordIdentities
): Promise
<InitializedRecord
[]>
Parameters​
Name | Type |
---|---|
recordIdentities | RecordIdentity [] |
Returns​
Promise
<InitializedRecord
[]>
Implementation of​
AsyncRecordAccessor.removeRecordsAsync
Defined in​
record-cache/src/async-record-cache.ts:164
setRecordAsync​
â–¸ Abstract
setRecordAsync(record
): Promise
<void
>
Parameters​
Name | Type |
---|---|
record | InitializedRecord |
Returns​
Promise
<void
>
Implementation of​
AsyncRecordAccessor.setRecordAsync
Defined in​
record-cache/src/async-record-cache.ts:159
setRecordsAsync​
â–¸ Abstract
setRecordsAsync(records
): Promise
<void
>
Parameters​
Name | Type |
---|---|
records | InitializedRecord [] |
Returns​
Promise
<void
>
Implementation of​
AsyncRecordAccessor.setRecordsAsync
Defined in​
record-cache/src/async-record-cache.ts:160
update​
â–¸ update<RequestData
>(transformOrOperations
, options?
, id?
): Promise
<RequestData
>
Updates the cache.
Type parameters​
Name | Type |
---|---|
RequestData | extends RecordTransformResult <InitializedRecord > = RecordTransformResult <InitializedRecord > |
Parameters​
Name | Type |
---|---|
transformOrOperations | TransformOrOperations <RecordOperation , TB > |
options? | DefaultRequestOptions <TO > |
id? | string |
Returns​
Promise
<RequestData
>
Implementation of​
AsyncRecordUpdatable.update
Defined in​
record-cache/src/async-record-cache.ts:266
â–¸ update<RequestData
>(transformOrOperations
, options
, id?
): Promise
<FullResponse
<RequestData
, TransformResponseDetails
, RecordOperation
>>
Type parameters​
Name | Type |
---|---|
RequestData | extends RecordTransformResult <InitializedRecord > = RecordTransformResult <InitializedRecord > |
Parameters​
Name | Type |
---|---|
transformOrOperations | TransformOrOperations <RecordOperation , TB > |
options | FullRequestOptions <TO > |
id? | string |
Returns​
Promise
<FullResponse
<RequestData
, TransformResponseDetails
, RecordOperation
>>
Implementation of​
AsyncRecordUpdatable.update