Class: LocalStorageCache<QO, TO, QB, TB, QRD, TRD>
A cache used to access records in local storage.
Because local storage access is synchronous, this cache extends SyncRecordCache
.
Type parameters​
Name | Type |
---|---|
QO | extends RequestOptions = RecordCacheQueryOptions |
TO | extends RequestOptions = RecordCacheTransformOptions |
QB | RecordQueryBuilder |
TB | RecordTransformBuilder |
QRD | unknown |
TRD | extends RecordCacheUpdateDetails = RecordCacheUpdateDetails |
Hierarchy​
SyncRecordCache
<QO
,TO
,QB
,TB
,QRD
,TRD
>↳
LocalStorageCache
Constructors​
constructor​
• new LocalStorageCache<QO
, TO
, QB
, TB
, QRD
, TRD
>(settings
)
Type parameters​
Name | Type |
---|---|
QO | extends RequestOptions = RecordCacheQueryOptions |
TO | extends RequestOptions = RecordCacheTransformOptions |
QB | RecordQueryBuilder <string , RecordIdentity > |
TB | RecordTransformBuilder <string , RecordIdentity , UninitializedRecord > |
QRD | unknown |
TRD | extends RecordCacheUpdateDetails = RecordCacheUpdateDetails |
Parameters​
Name | Type |
---|---|
settings | LocalStorageCacheSettings <QO , TO , QB , TB > |
Overrides​
SyncRecordCache<QO, TO, QB, TB, QRD, TRD\>.constructor
Defined in​
local-storage/src/local-storage-cache.ts:65
Accessors​
defaultQueryOptions​
• get
defaultQueryOptions(): undefined
| DefaultRequestOptions
<QueryOptions
>
Returns​
undefined
| DefaultRequestOptions
<QueryOptions
>
Inherited from​
SyncRecordCache.defaultQueryOptions
Defined in​
record-cache/dist/modules/record-cache.d.ts:53
• set
defaultQueryOptions(options
): void
Parameters​
Name | Type |
---|---|
options | undefined | DefaultRequestOptions <QueryOptions > |
Returns​
void
Inherited from​
SyncRecordCache.defaultQueryOptions
Defined in​
record-cache/dist/modules/record-cache.d.ts:54
defaultTransformOptions​
• get
defaultTransformOptions(): undefined
| DefaultRequestOptions
<TransformOptions
>
Returns​
undefined
| DefaultRequestOptions
<TransformOptions
>
Inherited from​
SyncRecordCache.defaultTransformOptions
Defined in​
record-cache/dist/modules/record-cache.d.ts:55
• set
defaultTransformOptions(options
): void
Parameters​
Name | Type |
---|---|
options | undefined | DefaultRequestOptions <TransformOptions > |
Returns​
void
Inherited from​
SyncRecordCache.defaultTransformOptions
Defined in​
record-cache/dist/modules/record-cache.d.ts:56
delimiter​
• get
delimiter(): string
Returns​
string
Defined in​
local-storage/src/local-storage-cache.ts:76
keyMap​
• get
keyMap(): undefined
| RecordKeyMap
Returns​
undefined
| RecordKeyMap
Inherited from​
SyncRecordCache.keyMap
Defined in​
record-cache/dist/modules/record-cache.d.ts:49
name​
• get
name(): undefined
| string
Returns​
undefined
| string
Inherited from​
SyncRecordCache.name
Defined in​
record-cache/dist/modules/record-cache.d.ts:47
namespace​
• get
namespace(): string
Returns​
string
Defined in​
local-storage/src/local-storage-cache.ts:72
processors​
• get
processors(): SyncOperationProcessor
[]
Returns​
SyncOperationProcessor
[]
Inherited from​
SyncRecordCache.processors
Defined in​
record-cache/dist/modules/sync-record-cache.d.ts:29
queryBuilder​
• get
queryBuilder(): QueryBuilder
Returns​
QueryBuilder
Inherited from​
SyncRecordCache.queryBuilder
Defined in​
record-cache/dist/modules/record-cache.d.ts:51
schema​
• get
schema(): RecordSchema
Returns​
RecordSchema
Inherited from​
SyncRecordCache.schema
Defined in​
record-cache/dist/modules/record-cache.d.ts:48
transformBuilder​
• get
transformBuilder(): TransformBuilder
Returns​
TransformBuilder
Inherited from​
SyncRecordCache.transformBuilder
Defined in​
record-cache/dist/modules/record-cache.d.ts:52
validatorFor​
• get
validatorFor(): undefined
| ValidatorForFn
<StandardValidator
| StandardRecordValidator
>
Returns​
undefined
| ValidatorForFn
<StandardValidator
| StandardRecordValidator
>
Inherited from​
SyncRecordCache.validatorFor
Defined in​
record-cache/dist/modules/record-cache.d.ts:50
Methods​
addInverseRelationshipsSync​
â–¸ addInverseRelationshipsSync(relationships
): void
Parameters​
Name | Type |
---|---|
relationships | RecordRelationshipIdentity [] |
Returns​
void
Overrides​
SyncRecordCache.addInverseRelationshipsSync
Defined in​
local-storage/src/local-storage-cache.ts:217
applyRecordChangesetSync​
â–¸ applyRecordChangesetSync(changeset
): void
Parameters​
Name | Type |
---|---|
changeset | RecordChangeset |
Returns​
void
Inherited from​
SyncRecordCache.applyRecordChangesetSync
Defined in​
record-cache/dist/modules/sync-record-cache.d.ts:42
emit​
â–¸ emit(event
, ...args
): void
Parameters​
Name | Type |
---|---|
event | Event |
...args | unknown [] |
Returns​
void
Inherited from​
SyncRecordCache.emit
Defined in​
core/dist/modules/evented.d.ts:23
getInverseRelationshipsSync​
â–¸ getInverseRelationshipsSync(recordIdentityOrIdentities
): RecordRelationshipIdentity
[]
Parameters​
Name | Type |
---|---|
recordIdentityOrIdentities | RecordIdentity | RecordIdentity [] |
Returns​
RecordRelationshipIdentity
[]
Overrides​
SyncRecordCache.getInverseRelationshipsSync
Defined in​
local-storage/src/local-storage-cache.ts:195
getInverseTransformOperator​
â–¸ getInverseTransformOperator(op
): SyncInverseTransformOperator
Parameters​
Name | Type |
---|---|
op | string |
Returns​
SyncInverseTransformOperator
Inherited from​
SyncRecordCache.getInverseTransformOperator
Defined in​
record-cache/dist/modules/sync-record-cache.d.ts:32
getKeyForRecord​
â–¸ getKeyForRecord(record
): string
Parameters​
Name | Type |
---|---|
record | RecordIdentity | InitializedRecord |
Returns​
string
Defined in​
local-storage/src/local-storage-cache.ts:80
getKeyForRecordInverses​
â–¸ getKeyForRecordInverses(record
): string
Parameters​
Name | Type |
---|---|
record | RecordIdentity | InitializedRecord |
Returns​
string
Defined in​
local-storage/src/local-storage-cache.ts:84
getQueryOperator​
â–¸ getQueryOperator(op
): SyncQueryOperator
Parameters​
Name | Type |
---|---|
op | string |
Returns​
SyncQueryOperator
Inherited from​
SyncRecordCache.getQueryOperator
Defined in​
record-cache/dist/modules/sync-record-cache.d.ts:30
getQueryOptions​
â–¸ getQueryOptions(query
, expression?
): undefined
| QO
Parameters​
Name | Type |
---|---|
query | RecordQuery |
expression? | RecordQueryExpression |
Returns​
undefined
| QO
Inherited from​
SyncRecordCache.getQueryOptions
Defined in​
record-cache/dist/modules/record-cache.d.ts:57
getRecordSync​
â–¸ getRecordSync(identity
): undefined
| InitializedRecord
Parameters​
Name | Type |
---|---|
identity | RecordIdentity |
Returns​
undefined
| InitializedRecord
Overrides​
SyncRecordCache.getRecordSync
Defined in​
local-storage/src/local-storage-cache.ts:90
getRecordsSync​
â–¸ getRecordsSync(typeOrIdentities?
): InitializedRecord
[]
Parameters​
Name | Type |
---|---|
typeOrIdentities? | string | RecordIdentity [] |
Returns​
InitializedRecord
[]
Overrides​
SyncRecordCache.getRecordsSync
Defined in​
local-storage/src/local-storage-cache.ts:107
getRelatedRecordSync​
â–¸ getRelatedRecordSync(identity
, relationship
): undefined
| null
| RecordIdentity
Parameters​
Name | Type |
---|---|
identity | RecordIdentity |
relationship | string |
Returns​
undefined
| null
| RecordIdentity
Inherited from​
SyncRecordCache.getRelatedRecordSync
Defined in​
record-cache/dist/modules/sync-record-cache.d.ts:43
getRelatedRecordsSync​
â–¸ getRelatedRecordsSync(identity
, relationship
): undefined
| RecordIdentity
[]
Parameters​
Name | Type |
---|---|
identity | RecordIdentity |
relationship | string |
Returns​
undefined
| RecordIdentity
[]
Inherited from​
SyncRecordCache.getRelatedRecordsSync
Defined in​
record-cache/dist/modules/sync-record-cache.d.ts:44
getTransformOperator​
â–¸ getTransformOperator(op
): SyncTransformOperator
Parameters​
Name | Type |
---|---|
op | string |
Returns​
SyncTransformOperator
Inherited from​
SyncRecordCache.getTransformOperator
Defined in​
record-cache/dist/modules/sync-record-cache.d.ts:31
getTransformOptions​
â–¸ getTransformOptions(transform
, operation?
): undefined
| TO
Parameters​
Name | Type |
---|---|
transform | RecordTransform |
operation? | RecordOperation |
Returns​
undefined
| TO
Inherited from​
SyncRecordCache.getTransformOptions
Defined in​
record-cache/dist/modules/record-cache.d.ts:58
listeners​
â–¸ listeners(event
): Listener
[]
Parameters​
Name | Type |
---|---|
event | Event |
Returns​
Listener
[]
Inherited from​
SyncRecordCache.listeners
Defined in​
core/dist/modules/evented.d.ts:24
liveQuery​
â–¸ liveQuery(queryOrExpressions
, options?
, id?
): SyncLiveQuery
<QO
, TO
, QB
, TB
>
Parameters​
Name | Type |
---|---|
queryOrExpressions | QueryOrExpressions <RecordQueryExpression , QB > |
options? | DefaultRequestOptions <QO > |
id? | string |
Returns​
SyncLiveQuery
<QO
, TO
, QB
, TB
>
Inherited from​
SyncRecordCache.liveQuery
Defined in​
record-cache/dist/modules/sync-record-cache.d.ts:61
off​
â–¸ off(event
, listener?
): void
Parameters​
Name | Type |
---|---|
event | Event |
listener? | Listener |
Returns​
void
Inherited from​
SyncRecordCache.off
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​
SyncRecordCache.on
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​
SyncRecordCache.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​
Name | Type |
---|---|
operationOrOperations | RecordOperation | RecordOperation [] | RecordTransformBuilderFunc | RecordOperationTerm <string , RecordIdentity , UninitializedRecord > | RecordOperationTerm <string , RecordIdentity , UninitializedRecord >[] |
Returns​
PatchResult
Inherited from​
SyncRecordCache.patch
Defined in​
record-cache/dist/modules/sync-record-cache.d.ts:60
query​
â–¸ query<RequestData
>(queryOrExpressions
, options?
, id?
): 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​
RequestData
Inherited from​
SyncRecordCache.query
Defined in​
record-cache/dist/modules/sync-record-cache.d.ts:48
â–¸ query<RequestData
>(queryOrExpressions
, options
, id?
): FullResponse
<RequestData
, QRD
, RecordOperation
>
Type parameters​
Name | Type |
---|---|
RequestData | extends RecordQueryResult <InitializedRecord > = RecordQueryResult <InitializedRecord > |
Parameters​
Name | Type |
---|---|
queryOrExpressions | QueryOrExpressions <RecordQueryExpression , QB > |
options | FullRequestOptions <QO > |
id? | string |
Returns​
FullResponse
<RequestData
, QRD
, RecordOperation
>
Inherited from​
SyncRecordCache.query
Defined in​
record-cache/dist/modules/sync-record-cache.d.ts:49
removeInverseRelationshipsSync​
â–¸ removeInverseRelationshipsSync(relationships
): void
Parameters​
Name | Type |
---|---|
relationships | RecordRelationshipIdentity [] |
Returns​
void
Overrides​
SyncRecordCache.removeInverseRelationshipsSync
Defined in​
local-storage/src/local-storage-cache.ts:229
removeRecordSync​
â–¸ removeRecordSync(recordIdentity
): undefined
| InitializedRecord
Parameters​
Name | Type |
---|---|
recordIdentity | RecordIdentity |
Returns​
undefined
| InitializedRecord
Overrides​
SyncRecordCache.removeRecordSync
Defined in​
local-storage/src/local-storage-cache.ts:169
removeRecordsSync​
â–¸ removeRecordsSync(recordIdentities
): InitializedRecord
[]
Parameters​
Name | Type |
---|---|
recordIdentities | RecordIdentity [] |
Returns​
InitializedRecord
[]
Overrides​
SyncRecordCache.removeRecordsSync
Defined in​
local-storage/src/local-storage-cache.ts:182
reset​
â–¸ reset(): void
Returns​
void
Defined in​
local-storage/src/local-storage-cache.ts:249
setRecordSync​
â–¸ setRecordSync(record
): void
Parameters​
Name | Type |
---|---|
record | InitializedRecord |
Returns​
void
Overrides​
SyncRecordCache.setRecordSync
Defined in​
local-storage/src/local-storage-cache.ts:153
setRecordsSync​
â–¸ setRecordsSync(records
): void
Parameters​
Name | Type |
---|---|
records | InitializedRecord [] |
Returns​
void
Overrides​
SyncRecordCache.setRecordsSync
Defined in​
local-storage/src/local-storage-cache.ts:163
update​
â–¸ update<RequestData
>(transformOrOperations
, options?
, id?
): 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​
RequestData
Inherited from​
SyncRecordCache.update
Defined in​
record-cache/dist/modules/sync-record-cache.d.ts:53
â–¸ update<RequestData
>(transformOrOperations
, options
, id?
): FullResponse
<RequestData
, TRD
, RecordOperation
>
Type parameters​
Name | Type |
---|---|
RequestData | extends RecordTransformResult <InitializedRecord > = RecordTransformResult <InitializedRecord > |
Parameters​
Name | Type |
---|---|
transformOrOperations | TransformOrOperations <RecordOperation , TB > |
options | FullRequestOptions <TO > |
id? | string |
Returns​
FullResponse
<RequestData
, TRD
, RecordOperation
>
Inherited from​
SyncRecordCache.update
Defined in​
record-cache/dist/modules/sync-record-cache.d.ts:54
upgrade​
â–¸ upgrade(): void
Returns​
void