Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Counter

Counter of data signals that carry true.

This class implements a counter that is updated in runtime O(1) whenever a signal changes.

Hierarchy

  • Counter

Index

Constructors

Methods

Constructors

constructor

  • new Counter(count: DataSignal<number>): Counter
  • Constructor.

    Parameters

    • count: DataSignal<number>

      Signal that will be carry the number of true signals observed by this counter.

    Returns Counter

Methods

add

  • add(signal: function): void
  • Adds a signal to the counter.

    throws

    Error if the given signal has been added before

    Parameters

    • signal: function
        • (): boolean
        • Returns boolean

    Returns void

delete

  • delete(signal: function): void
  • Removes a signal from the counter.

    throws

    Error if the given signal has not previously beend added with add()

    Parameters

    • signal: function
        • (): boolean
        • Returns boolean

    Returns void

Generated using TypeDoc