Documentation - v1.2.0-alpha.3
    Preparing search index...

    A simple in-memory storage provider that implements the Storage interface.

    This class provides a volatile storage solution that keeps data in memory, which means data is lost when the process terminates. It's primarily useful for:

    • Development and testing scenarios
    • Simple applications that don't require data persistence across restarts
    • Stateless environments where external storage isn't available

    MemoryStorage supports optimistic concurrency control through eTags and can be used as a singleton through the getSingleInstance() method to share state across different parts of an application.

    Implements

    Index

    Constructors

    Methods

    • Writes storage items to memory.

      Parameters

      • changes: StoreItem

        The items to write, indexed by key

      Returns Promise<void>

      A promise that resolves when the write operation is complete

      Will throw an error if changes are not provided or if there's an eTag conflict

      This method supports optimistic concurrency control through eTags. If an item has an eTag, it will only be updated if the existing item has the same eTag. If an item has an eTag of '*' or no eTag, it will always be written regardless of the current state.