Class MemoryRecorder

This recorder will

  • store auto-snapshots (afterDispatch) in memory after every dispatch (for time traveling)
  • store manual snapshots in memory

Hierarchy

  • MemoryRecorder

Implements

Constructors

Properties

autoSnaps: Snapshot[] = []
manualSnaps: Snapshot[] = []

Methods

  • Records a snapshot. This function is called by AppEngine after EVERY state dispatch. It is up to you to decide where to store this Snapshot, if at all.

    Possible use case:

    • for quick time traveling while debugging: store it into an array in memory
    • if you want to persist every snapshot, you may consider to implement createSnapshot() and implement record as "return createSnapshot(snapshot)"

    Parameters

    • snapshot: Snapshot

      A deepcloned snapshot

    Returns Promise<void>

  • Called when you explicitly call AppEngine::createSnapshot() It is up to you to decide where to store this Snapshot. Omit this function to disable explicit snapshot creation

    Parameters

    Returns Promise<void>

    The saved snapshot

  • Loads a snapshot. Called by AppEngine::loadSnapshot(), which will then load this snapshot's state into your App Omit this function if you do not want persistence

    Parameters

    • Optional id: string

      Optional snapshot id, if omitted, you should return the latest snapshot

      Optional

    Returns Promise<null | Snapshot>

    The loaded snapshot or null

Generated using TypeDoc