Options
All
  • Public
  • Public/Protected
  • All
Menu

Class LazyComputationNode<T, K>

Type parameters

Hierarchy

Implements

Constructors

constructor

Properties

Protected calculate

calculate: ProcessingFunction<K, T>

Function to calculate input from output.

emitter

emitter: BitFieldEmitter<void> = new BitFieldEmitter<void>()

Emitter emiting events from the computationEvents enum.

Protected inputEmitters

inputEmitters: BitFieldEmitter<void>[]

Array of all inputEmitters the node has.

Protected inputs

inputs: K

Input nodes to react on.

state

state: computationFlags = computationFlags.activeAndDirty

inner property keeping track of the state

Protected Optional value

value: T

Inner property containing the current value of the node.

Protected volatileHandlers

volatileHandlers: Set<function> = new Set<BitFieldEventHandler<void>>()

Handlers to remove on dispose.

Methods

dispose

  • dispose(): this
  • Dispose the current node. Each node which extends this class is free to use the active state however it wants.

    Returns this

    The BaseComputationNode instance.

get

  • get(): NonNullable<T>
  • Returns the current vaule of the node.

    Note: if the state of the node is "dirty" an update will be triggered.

    Returns NonNullable<T>

isActive

  • isActive(): number

Protected postUpdate

  • postUpdate(): void

triggerUpdate

  • triggerUpdate(): this
  • Trigger an update of the entire node.

    Note: the "changed" event won't be emited if the new value is the same as the old one.

    Note: the "updated" event will be emited even if the value is the same as the old one.

    Note: both the "updated" and "changed" events will be emitted at the same time.

    emits

    computationEvents.updated

    emits

    computationEvents.changed

    emits

    computationEvents.updated

    emits

    computationEvents.changed

    emits

    computationEvents.updated

    emits

    computationEvents.changed

    Returns this

    The LazyComputationNode instance.

Generated using TypeDoc