Skip to content

MetadataCache.transactionSave method

MetadataCache › transactionSave

Unofficial

Writes a file cache entry to the file store of the cache database, or deletes the key when value is null.

Signature:

transactionSave(storeName: "file", key: string, value: FileCacheEntry | null): Promise<IDBValidKey | undefined>

Parameters:

ParameterTypeDescription
storeName"file"The object store.
keystringThe file path.
valueFileCacheEntry | nullThe entry to write, or null to delete the key.

Returns: Promise<IDBValidKey | undefined> — The written key, or undefined after a delete.

Remarks:

Unset until the cache database opens during preload, and for the whole session if it fails to open.

Unofficial

Writes a metadata cache entry to the metadata store of the cache database, or deletes the key when value is null.

Signature:

transactionSave(storeName: "metadata", key: string, value: CachedMetadata | null): Promise<IDBValidKey | undefined>

Parameters:

ParameterTypeDescription
storeName"metadata"The object store.
keystringThe file hash.
valueCachedMetadata | nullThe entry to write, or null to delete the key.

Returns: Promise<IDBValidKey | undefined> — The written key, or undefined after a delete.

Remarks:

Unset until the cache database opens during preload, and for the whole session if it fails to open.