Skip to main content
Version: 0.17

Class: AsyncRecordCache<QO, TO, QB, TB, QueryResponseDetails, TransformResponseDetails>

Type parameters​

NameType
QOextends RequestOptions = RecordCacheQueryOptions
TOextends RequestOptions = RecordCacheTransformOptions
QBRecordQueryBuilder
TBRecordTransformBuilder
QueryResponseDetailsunknown
TransformResponseDetailsextends RecordCacheUpdateDetails = RecordCacheUpdateDetails

Hierarchy​

Implements​

  • AsyncRecordAccessor
  • AsyncRecordQueryable<QueryResponseDetails, QB, QO>
  • AsyncRecordUpdatable<TransformResponseDetails, TB, TO>

Constructors​

constructor​

• new AsyncRecordCache<QO, TO, QB, TB, QueryResponseDetails, TransformResponseDetails>(settings)

Type parameters​

NameType
QOextends RequestOptions = RecordCacheQueryOptions
TOextends RequestOptions = RecordCacheTransformOptions
QBRecordQueryBuilder<string, RecordIdentity>
TBRecordTransformBuilder<string, RecordIdentity, UninitializedRecord>
QueryResponseDetailsunknown
TransformResponseDetailsextends RecordCacheUpdateDetails = RecordCacheUpdateDetails

Parameters​

NameType
settingsAsyncRecordCacheSettings<QO, TO, QB, TB>

Overrides​

RecordCache.constructor

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​

NameType
optionsundefined | 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​

NameType
optionsundefined | 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​

AsyncRecordAccessor.keyMap

Inherited from​

RecordCache.keyMap

Defined in​

record-cache/src/record-cache.ts:169


name​

• get name(): undefined | string

Returns​

undefined | string

Implementation of​

AsyncRecordAccessor.name

Inherited from​

RecordCache.name

Defined in​

record-cache/src/record-cache.ts:161


processors​

• get processors(): AsyncOperationProcessor[]

Returns​

AsyncOperationProcessor[]

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​

AsyncRecordAccessor.schema

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​

NameType
relationshipsRecordRelationshipIdentity[]

Returns​

Promise<void>

Implementation of​

AsyncRecordAccessor.addInverseRelationshipsAsync

Defined in​

record-cache/src/async-record-cache.ts:167


applyRecordChangesetAsync​

â–¸ applyRecordChangesetAsync(changeset): Promise<void>

Parameters​

NameType
changesetRecordChangeset

Returns​

Promise<void>

Implementation of​

AsyncRecordAccessor.applyRecordChangesetAsync

Defined in​

record-cache/src/async-record-cache.ts:174


emit​

â–¸ emit(event, ...args): void

Parameters​

NameType
eventEvent
...argsunknown[]

Returns​

void

Inherited from​

RecordCache.emit

Defined in​

core/dist/modules/evented.d.ts:23


getInverseRelationshipsAsync​

â–¸ Abstract getInverseRelationshipsAsync(recordIdentityOrIdentities): Promise<RecordRelationshipIdentity[]>

Parameters​

NameType
recordIdentityOrIdentitiesRecordIdentity | RecordIdentity[]

Returns​

Promise<RecordRelationshipIdentity[]>

Implementation of​

AsyncRecordAccessor.getInverseRelationshipsAsync

Defined in​

record-cache/src/async-record-cache.ts:154


getInverseTransformOperator​

â–¸ getInverseTransformOperator(op): AsyncInverseTransformOperator

Parameters​

NameType
opstring

Returns​

AsyncInverseTransformOperator

Defined in​

record-cache/src/async-record-cache.ts:143


getQueryOperator​

â–¸ getQueryOperator(op): AsyncQueryOperator

Parameters​

NameType
opstring

Returns​

AsyncQueryOperator

Defined in​

record-cache/src/async-record-cache.ts:135


getQueryOptions​

â–¸ getQueryOptions(query, expression?): undefined | QO

Parameters​

NameType
queryRecordQuery
expression?RecordQueryExpression

Returns​

undefined | QO

Inherited from​

RecordCache.getQueryOptions

Defined in​

record-cache/src/record-cache.ts:209


getRecordAsync​

â–¸ Abstract getRecordAsync(recordIdentity): Promise<undefined | InitializedRecord>

Parameters​

NameType
recordIdentityRecordIdentity

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​

NameType
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​

NameType
identityRecordIdentity
relationshipstring

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​

NameType
identityRecordIdentity
relationshipstring

Returns​

Promise<undefined | RecordIdentity[]>

Implementation of​

AsyncRecordAccessor.getRelatedRecordsAsync

Defined in​

record-cache/src/async-record-cache.ts:215


getTransformOperator​

â–¸ getTransformOperator(op): AsyncTransformOperator

Parameters​

NameType
opstring

Returns​

AsyncTransformOperator

Defined in​

record-cache/src/async-record-cache.ts:139


getTransformOptions​

â–¸ getTransformOptions(transform, operation?): undefined | TO

Parameters​

NameType
transformRecordTransform
operation?RecordOperation

Returns​

undefined | TO

Inherited from​

RecordCache.getTransformOptions

Defined in​

record-cache/src/record-cache.ts:223


listeners​

â–¸ listeners(event): Listener[]

Parameters​

NameType
eventEvent

Returns​

Listener[]

Inherited from​

RecordCache.listeners

Defined in​

core/dist/modules/evented.d.ts:24


liveQuery​

â–¸ liveQuery(queryOrExpressions, options?, id?): AsyncLiveQuery<QO, TO, QB, TB>

Parameters​

NameType
queryOrExpressionsQueryOrExpressions<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​

NameType
eventEvent
listener?Listener

Returns​

void

Inherited from​

RecordCache.off

Defined in​

core/dist/modules/evented.d.ts:21


on​

â–¸ on(event, listener): () => void

Parameters​

NameType
eventEvent
listenerListener

Returns​

fn

â–¸ (): void

Returns​

void

Inherited from​

RecordCache.on

Defined in​

core/dist/modules/evented.d.ts:20


one​

â–¸ one(event, listener): () => void

Parameters​

NameType
eventEvent
listenerListener

Returns​

fn

â–¸ (): void

Returns​

void

Inherited from​

RecordCache.one

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​

NameType
operationOrOperationsRecordOperation | 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​

NameType
RequestDataextends RecordQueryResult<InitializedRecord> = RecordQueryResult<InitializedRecord>

Parameters​

NameType
queryOrExpressionsQueryOrExpressions<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​

NameType
RequestDataextends RecordQueryResult<InitializedRecord> = RecordQueryResult<InitializedRecord>

Parameters​

NameType
queryOrExpressionsQueryOrExpressions<RecordQueryExpression, QB>
optionsFullRequestOptions<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​

NameType
relationshipsRecordRelationshipIdentity[]

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​

NameType
recordIdentityRecordIdentity

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​

NameType
recordIdentitiesRecordIdentity[]

Returns​

Promise<InitializedRecord[]>

Implementation of​

AsyncRecordAccessor.removeRecordsAsync

Defined in​

record-cache/src/async-record-cache.ts:164


setRecordAsync​

â–¸ Abstract setRecordAsync(record): Promise<void>

Parameters​

NameType
recordInitializedRecord

Returns​

Promise<void>

Implementation of​

AsyncRecordAccessor.setRecordAsync

Defined in​

record-cache/src/async-record-cache.ts:159


setRecordsAsync​

â–¸ Abstract setRecordsAsync(records): Promise<void>

Parameters​

NameType
recordsInitializedRecord[]

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​

NameType
RequestDataextends RecordTransformResult<InitializedRecord> = RecordTransformResult<InitializedRecord>

Parameters​

NameType
transformOrOperationsTransformOrOperations<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​

NameType
RequestDataextends RecordTransformResult<InitializedRecord> = RecordTransformResult<InitializedRecord>

Parameters​

NameType
transformOrOperationsTransformOrOperations<RecordOperation, TB>
optionsFullRequestOptions<TO>
id?string

Returns​

Promise<FullResponse<RequestData, TransformResponseDetails, RecordOperation>>

Implementation of​

AsyncRecordUpdatable.update

Defined in​

record-cache/src/async-record-cache.ts:271