Skip to main content
Version: 0.17

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

Type parameters​

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

Hierarchy​

Implements​

  • SyncRecordAccessor
  • SyncRecordQueryable<QueryResponseDetails, QB, QO>
  • SyncRecordUpdatable<TransformResponseDetails, TB, TO>

Constructors​

constructor​

• new SyncRecordCache<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
settingsSyncRecordCacheSettings<QO, TO, QB, TB>

Overrides​

RecordCache.constructor

Defined in​

record-cache/src/sync-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​

SyncRecordAccessor.keyMap

Inherited from​

RecordCache.keyMap

Defined in​

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


name​

• get name(): undefined | string

Returns​

undefined | string

Implementation of​

SyncRecordAccessor.name

Inherited from​

RecordCache.name

Defined in​

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


processors​

• get processors(): SyncOperationProcessor[]

Returns​

SyncOperationProcessor[]

Defined in​

record-cache/src/sync-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​

SyncRecordAccessor.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​

addInverseRelationshipsSync​

â–¸ Abstract addInverseRelationshipsSync(relationships): void

Parameters​

NameType
relationshipsRecordRelationshipIdentity[]

Returns​

void

Implementation of​

SyncRecordAccessor.addInverseRelationshipsSync

Defined in​

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


applyRecordChangesetSync​

â–¸ applyRecordChangesetSync(changeset): void

Parameters​

NameType
changesetRecordChangeset

Returns​

void

Implementation of​

SyncRecordAccessor.applyRecordChangesetSync

Defined in​

record-cache/src/sync-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


getInverseRelationshipsSync​

â–¸ Abstract getInverseRelationshipsSync(recordIdentityOrIdentities): RecordRelationshipIdentity[]

Parameters​

NameType
recordIdentityOrIdentitiesRecordIdentity | RecordIdentity[]

Returns​

RecordRelationshipIdentity[]

Implementation of​

SyncRecordAccessor.getInverseRelationshipsSync

Defined in​

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


getInverseTransformOperator​

â–¸ getInverseTransformOperator(op): SyncInverseTransformOperator

Parameters​

NameType
opstring

Returns​

SyncInverseTransformOperator

Defined in​

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


getQueryOperator​

â–¸ getQueryOperator(op): SyncQueryOperator

Parameters​

NameType
opstring

Returns​

SyncQueryOperator

Defined in​

record-cache/src/sync-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


getRecordSync​

â–¸ Abstract getRecordSync(recordIdentity): undefined | InitializedRecord

Parameters​

NameType
recordIdentityRecordIdentity

Returns​

undefined | InitializedRecord

Implementation of​

SyncRecordAccessor.getRecordSync

Defined in​

record-cache/src/sync-record-cache.ts:148


getRecordsSync​

â–¸ Abstract getRecordsSync(typeOrIdentities?): InitializedRecord[]

Parameters​

NameType
typeOrIdentities?string | RecordIdentity[]

Returns​

InitializedRecord[]

Implementation of​

SyncRecordAccessor.getRecordsSync

Defined in​

record-cache/src/sync-record-cache.ts:151


getRelatedRecordSync​

â–¸ getRelatedRecordSync(identity, relationship): undefined | null | RecordIdentity

Parameters​

NameType
identityRecordIdentity
relationshipstring

Returns​

undefined | null | RecordIdentity

Implementation of​

SyncRecordAccessor.getRelatedRecordSync

Defined in​

record-cache/src/sync-record-cache.ts:196


getRelatedRecordsSync​

â–¸ getRelatedRecordsSync(identity, relationship): undefined | RecordIdentity[]

Parameters​

NameType
identityRecordIdentity
relationshipstring

Returns​

undefined | RecordIdentity[]

Implementation of​

SyncRecordAccessor.getRelatedRecordsSync

Defined in​

record-cache/src/sync-record-cache.ts:207


getTransformOperator​

â–¸ getTransformOperator(op): SyncTransformOperator

Parameters​

NameType
opstring

Returns​

SyncTransformOperator

Defined in​

record-cache/src/sync-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?): SyncLiveQuery<QO, TO, QB, TB>

Parameters​

NameType
queryOrExpressionsQueryOrExpressions<RecordQueryExpression, QB>
options?DefaultRequestOptions<QO>
id?string

Returns​

SyncLiveQuery<QO, TO, QB, TB>

Defined in​

record-cache/src/sync-record-cache.ts:319


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): 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​

PatchResult

Defined in​

record-cache/src/sync-record-cache.ts:295


query​

â–¸ query<RequestData>(queryOrExpressions, options?, id?): RequestData

Queries the cache.

Type parameters​

NameType
RequestDataextends RecordQueryResult<InitializedRecord> = RecordQueryResult<InitializedRecord>

Parameters​

NameType
queryOrExpressionsQueryOrExpressions<RecordQueryExpression, QB>
options?DefaultRequestOptions<QO>
id?string

Returns​

RequestData

Implementation of​

SyncRecordQueryable.query

Defined in​

record-cache/src/sync-record-cache.ts:221

â–¸ query<RequestData>(queryOrExpressions, options, id?): FullResponse<RequestData, QueryResponseDetails, RecordOperation>

Type parameters​

NameType
RequestDataextends RecordQueryResult<InitializedRecord> = RecordQueryResult<InitializedRecord>

Parameters​

NameType
queryOrExpressionsQueryOrExpressions<RecordQueryExpression, QB>
optionsFullRequestOptions<QO>
id?string

Returns​

FullResponse<RequestData, QueryResponseDetails, RecordOperation>

Implementation of​

SyncRecordQueryable.query

Defined in​

record-cache/src/sync-record-cache.ts:226


removeInverseRelationshipsSync​

â–¸ Abstract removeInverseRelationshipsSync(relationships): void

Parameters​

NameType
relationshipsRecordRelationshipIdentity[]

Returns​

void

Implementation of​

SyncRecordAccessor.removeInverseRelationshipsSync

Defined in​

record-cache/src/sync-record-cache.ts:170


removeRecordSync​

â–¸ Abstract removeRecordSync(recordIdentity): undefined | InitializedRecord

Parameters​

NameType
recordIdentityRecordIdentity

Returns​

undefined | InitializedRecord

Implementation of​

SyncRecordAccessor.removeRecordSync

Defined in​

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


removeRecordsSync​

â–¸ Abstract removeRecordsSync(recordIdentities): InitializedRecord[]

Parameters​

NameType
recordIdentitiesRecordIdentity[]

Returns​

InitializedRecord[]

Implementation of​

SyncRecordAccessor.removeRecordsSync

Defined in​

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


setRecordSync​

â–¸ Abstract setRecordSync(record): void

Parameters​

NameType
recordInitializedRecord

Returns​

void

Implementation of​

SyncRecordAccessor.setRecordSync

Defined in​

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


setRecordsSync​

â–¸ Abstract setRecordsSync(records): void

Parameters​

NameType
recordsInitializedRecord[]

Returns​

void

Implementation of​

SyncRecordAccessor.setRecordsSync

Defined in​

record-cache/src/sync-record-cache.ts:160


update​

â–¸ update<RequestData>(transformOrOperations, options?, id?): RequestData

Updates the cache.

Type parameters​

NameType
RequestDataextends RecordTransformResult<InitializedRecord> = RecordTransformResult<InitializedRecord>

Parameters​

NameType
transformOrOperationsTransformOrOperations<RecordOperation, TB>
options?DefaultRequestOptions<TO>
id?string

Returns​

RequestData

Implementation of​

SyncRecordUpdatable.update

Defined in​

record-cache/src/sync-record-cache.ts:257

â–¸ update<RequestData>(transformOrOperations, options, id?): FullResponse<RequestData, TransformResponseDetails, RecordOperation>

Type parameters​

NameType
RequestDataextends RecordTransformResult<InitializedRecord> = RecordTransformResult<InitializedRecord>

Parameters​

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

Returns​

FullResponse<RequestData, TransformResponseDetails, RecordOperation>

Implementation of​

SyncRecordUpdatable.update

Defined in​

record-cache/src/sync-record-cache.ts:262