Interface Recorder

A recorder stores Snapshots. You can use a Recorder

  • to timetravel through state changes
  • to persist snapshots so that you can intialize faster later

Hierarchy

  • Recorder

Implemented by

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