Class SimulatedCollection<T>

The SimulatedCollection() class extends from Collection. It shares similar properties except the data is simulated locally.

Type Parameters

Hierarchy

Constructors

Properties

dbInstance: null
debug: Debugger = ...
name: string
simulatedContent: DMap<string, T[keyof T]>

Methods

  • The handleChanges() abstract method will be used to handle DataChanges to match the database required form. Note: Different databases require different procedures to process DataChanges.

    Abstract

    Parameters

    • changes: DataChanges[]

      Received changes.

    Returns Promise<DataChanges[]>

  • Returns null | {
        content: {
            [key: string]: any;
        };
        exported: number;
    }

  • The pushChanges() method push incoming changes to the database.

    Parameters

    • changes: ChangeList

      Received changes.

    • strict: boolean = true

      Only allow LiveDMap changes to be pushed to the database.

    Returns Promise<boolean>

  • The readFromCacheNoRef() method retrieve data from saved cache without referable property.

    Parameters

    • autoFetch: boolean = false

      Automatically fetch data from the database if it is not presented.

    Returns Promise<null | DMap<string, T[keyof T]>>

  • The verifyChanges() abstract method will be used to verify changes pushed to the database. Note: Different databases may require different procedures.

    Abstract

    Parameters

    • changes: DataChanges[]

      Expected changes.

    Returns Promise<boolean>

Generated using TypeDoc