@yorkie-js/sdk
    Preparing search index...

    Class MemoryDocStore

    MemoryDocStore is an in-memory DocStore implementation. It holds the persisted envelopes in a Map for the lifetime of the process and carries no external dependency. It is the default store used when a durable backend is not configured, and it doubles as a test double for the persistence loop.

    Each stored value is defensively copied on both save and load so a caller mutating the returned buffer cannot corrupt the stored snapshot.

    Implements

    Index

    Constructors

    Methods

    Constructors

    Methods

    • load returns a copy of the persisted bytes for the document key, or undefined when nothing is stored.

      Parameters

      • docKey: string

      Returns Promise<Uint8Array<ArrayBufferLike> | undefined>

    • remove deletes any persisted bytes for the document key.

      Parameters

      • docKey: string

      Returns Promise<void>

    • save stores a copy of the given bytes under the document key.

      Parameters

      • docKey: string
      • bytes: Uint8Array

      Returns Promise<void>