InMemorySyncStorage

See source code
Table of contents

In-memory implementation of TLSyncStorage using AtomMap for documents and tombstones, and atoms for clock values. This is the default storage implementation used by TLSyncRoom.

class InMemorySyncStorage<R extends UnknownRecord>
  implements TLSyncStorage<R> {}

Constructor

Constructs a new instance of the InMemorySyncStorage class

Parameters

NameDescription

{ snapshot, onChange, }

{
  onChange?(
    arg: TLSyncStorageOnChangeCallbackProps
  ): unknown
  snapshot?: RoomSnapshot
}

Methods

getClock( )

getClock(): number

getSnapshot( )

getSnapshot(): RoomSnapshot

onChange( )

onChange(
  callback: (arg: TLSyncStorageOnChangeCallbackProps) => unknown
): () => void

Parameters

NameDescription

callback

(
  arg: TLSyncStorageOnChangeCallbackProps
) => unknown

Returns

() => void

transaction( )

Parameters

Returns


Prev
StoreSideEffects
Next
JsonChunkAssembler