Class ClassState<T>

Type Parameters

  • T = any

Hierarchy

  • ClassState

Constructors

Properties

changeDetector: ((last: any, current: any, item: object) => undefined | ItemChanges<object>) = ...

Type declaration

    • (last: any, current: any, item: object): undefined | ItemChanges<object>
    • Parameters

      • last: any
      • current: any
      • item: object

      Returns undefined | ItemChanges<object>

classSchema: ReflectionClass<T>
primaryKeyExtractor: ((value: any) => Partial<T>) = ...

Type declaration

    • (value: any): Partial<T>
    • Extracts the primary key of a snapshot and converts to class type.

      Parameters

      • value: any

      Returns Partial<T>

primaryKeyHashGenerator: ((value: any) => string) = ...

Type declaration

    • (value: any): string
    • Creates a primary key hash generator that takes an item from any format converts it to class format, then to plain, then uses the primitive values to create a string hash.

      This function is designed to work on the plain values (db records or json values)

      Parameters

      • value: any

      Returns string

simplePrimaryKeyHashGenerator: ((data: any) => string) = ...

Type declaration

    • (data: any): string
    • Parameters

      • data: any

      Returns string

snapshot: ((value: any) => any) = ...

Type declaration

    • (value: any): any
    • Creates a new JIT compiled function to convert the class instance to a snapshot. A snapshot is essentially the class instance as plain serialization while references are stored only as their primary keys.

      Generated function is cached.

      Parameters

      • value: any

      Returns any

Generated using TypeDoc