Function getSnapshot

  • Retrieves an immutable snapshot for a data structure. Since returned snapshots are immutable they will respect shallow equality, this is, if no changes are made then the snapshot will be kept the same.

    Type Parameters

    Parameters

    • type: T
    • nodeOrPrimitive: TypeToData<T>

      Data structure, including primtives.

    Returns SnapshotOutOf<TypeToData<T>>

    The snapshot.

    Typeparam

    T Object type.

  • Retrieves an immutable snapshot for a data structure. Since returned snapshots are immutable they will respect shallow equality, this is, if no changes are made then the snapshot will be kept the same.

    Type Parameters

    • T

    Parameters

    • nodeOrPrimitive: T

      Data structure, including primtives.

    Returns SnapshotOutOf<T>

    The snapshot.

    Typeparam

    T Object type.