Class ManagerProxy<Model, Manager, ModelType>

proxy of manager

  • save model internally, and update only if changed properties. Model extends CoreModel, ModelType extends string

Type Parameters

Hierarchy

  • ManagerProxy

Constructors

Properties

Accessors

Methods

Constructors

Properties

$mgr: Manager
_new: { [key: string]: Model } = {}

store the updated one.

Type declaration

  • [key: string]: Model
_org: { [key: string]: Model } = {}

store the origin model.

  • null means 404 not found

Type declaration

  • [key: string]: Model

Accessors

Methods

  • get all the updated node.

    Parameters

    • onlyUpdated: boolean = true

      flag to return the only updated set. (useful to check whether to update really!)

    • onlyValid: boolean = true

    Returns { [key: string]: Model }

    • [key: string]: Model
  • read the node.

    Parameters

    • id: string

      object-id

    • Optional defaultOrThrow: boolean | Model

      (optional) create if not exists, or flag to throw error

    Returns Promise<Model>

  • increment the field of Object[id] !WARN! this incremented properties should NOT be updated later.

    Parameters

    • id: string
    • model: Model

    Returns Promise<Model>

  • read the origin node (cloned not to change).

    Parameters

    • id: string
    • raw: boolean = false

    Returns Model

  • override w/ model

    Parameters

    • $org: Model

      the origin model by .get(id)

    • model: Model

      the new model.

    Returns Model

Generated using TypeDoc