Skip to main content

Interface: ExperimentalKVStore

Store defines a transactional key/value store that Replicache stores all data within.

For correct operation of Replicache, implementations of this interface must provide strict serializable transactions.

Informally, read and write transactions must behave like a ReadWrite Lock - multiple read transactions are allowed in parallel, or one write. Additionally writes from a transaction must appear all at one, atomically.

This interface is experimental and might be removed or changed in the future without following semver versioning. Please be cautious.

Properties

closed

closed: boolean

Methods

close

close(): Promise<void>

Returns

Promise<void>


read

read(): Promise<ExperimentalKVRead>

Returns

Promise<ExperimentalKVRead>


withRead

withRead<R>(f): Promise<R>

Type parameters

Name
R

Parameters

NameType
f(read: ExperimentalKVRead) => R | Promise<R>

Returns

Promise<R>


withWrite

withWrite<R>(f): Promise<R>

Type parameters

Name
R

Parameters

NameType
f(write: ExperimentalKVWrite) => R | Promise<R>

Returns

Promise<R>


write

write(): Promise<ExperimentalKVWrite>

Returns

Promise<ExperimentalKVWrite>