Skip to main content

CommonVariableContainer

Callable

  • CommonVariableContainer<T1, T2>(defaults: T1, extraVars?: T2, resetCallbacks?: { replacer?: (this: any, key: string, value: any) => any; reviver?: (this: any, key: string, value: any) => any }): VariableContainer<T1, T2>

  • Construct an object for holding arbitrary (user-specified) values with a mechanism to reset them to a default


    Type parameters

    • T1
    • T2 = {}

    Parameters

    • defaults: T1

      Default values that should be restored upon reset

    • extraVars: T2 = null

      Extra values that should not affected by resets

    • resetCallbacks: { replacer?: (this: any, key: string, value: any) => any; reviver?: (this: any, key: string, value: any) => any } = null

      Extra callbacks for affecting the deep cloning process on reset. Generally only relevant if one of the fields contains non-JSON-serializible data.

      • optionalreplacer: (this: any, key: string, value: any) => any
      • optionalreviver: (this: any, key: string, value: any) => any

    Returns VariableContainer<T1, T2>

    • The newly created object