Interface IDynamicConfigHandler<T>

This interface identifies the config which can track changes

Type Parameters

Hierarchy

  • IDynamicConfigHandler

Properties

blkVal: (<C, V>(target, name) => V)

Type declaration

    • <C, V>(target, name): V
    • Set the value that is or will be assigned to this named property of the target will not have it's properties converted into dynamic properties, this means that any changes the values properties will not be monitored for changes and therefore will not cause any listeners to be notified in any value is changed. If the value associated with the target[name] is change this is still dynamic and will cause listeners to be notified.

      Type Parameters

      • C

      • V = any

      Parameters

      • target: C

        The object which has (or will have) the named property

      • name: string

        The name of the property in the target

      Returns V

      The referenced properties current value.

      Example

      let localValue = target[name];   // If within a listener this will cause the listener to be called again
      target[name] = newValue; // This will notify listeners that accessed target[name]

      // This will not cause lsiteners to be called because propa is not converted and value of target[name]
      // did not change.
      target[name].propa = 1;
      target[name].propb = 2;

      // If within a listener this will caused the listener to be called again only if target[name] is reassigned
      // not if the value associated with propa is changed.
      let localValue = target[name].propa;
cfg: T

Link back to the configuration object that should be used to get/set values

The logger instance to use to logger any issues

notify: (() => void)

Type declaration

    • (): void
    • Helper to call any listeners that are waiting to be notified

      Returns void

rdOnly: (<C, V>(target, name) => V)

Type declaration

    • <C, V>(target, name): V
    • Set this named property of the target as read-only, which will block this single named property from ever being changed for the target instance. This does NOT freeze or seal the instance, it just stops the direct re-assignment of the named property, if the value is a non-primitive (ie. an object or array) it's properties will still be mutable.

      Type Parameters

      • C

      • V = any

      Parameters

      • target: C

        The object which has (or will have) the named property

      • name: string

        The name of the property in the target

      Returns V

      The referenced properties current value.

ref: (<C, V>(target, name) => V)

Type declaration

    • <C, V>(target, name): V
    • Set this named property of the target as referenced, which will cause any object or array instances to be updated in-place rather than being entirely replaced. All other values will continue to be replaced.

      Type Parameters

      • C

      • V = any

      Parameters

      • target: C

        The object which has (or will have) the named property

      • name: string

        The name of the property in the target

      Returns V

      The referenced properties current value.

set: (<C, V>(theConfig, name, value) => V)

Type declaration

    • <C, V>(theConfig, name, value): V
    • Set the value against the provided config/name with the value, the property will be converted to be dynamic (if not already) as long as the provided config is already a tracked dynamic object.

      Type Parameters

      • C

      • V

      Parameters

      • theConfig: C
      • name: string
      • value: V

      Returns V

      Throws

      TypeError if the provided config is not a monitored dynamic config

setDf: (<C>(theConfig, defaultValues) => C)

Type declaration

    • <C>(theConfig, defaultValues): C
    • Set default values for the config if not present.

      Type Parameters

      • C

      Parameters

      • theConfig: C

        The configuration object to set default on (if missing)

      • defaultValues: IConfigDefaults<C, T>

        The default values to apply to the config

      Returns C

uid: string

Unique Id for this config handler

watch: ((configHandler) => IWatcherHandler<T>)

Type declaration

Generated using TypeDoc