Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Counter

Counter class for keeping track of counts

Hierarchy

  • Counter

Index

Properties

count

count: number = 0

Methods

change

  • change(delta: number): void
  • Change the count

    fires

    Counter#countChanged

    Parameters

    • delta: number

      count change

    Returns void

clear

  • clear(): void

decrement

  • decrement(): void

dispose

  • dispose(): void

increment

  • increment(): void

listen

  • Listen to another counter object and change this count by the same amount

    Parameters

    • counter: Counter

      the counter object to listen to

    Returns void

onZeroOnce

  • onZeroOnce(callback: function, context?: any): void
  • Invole the callback function once, when the count becomes zero

    Parameters

    • callback: function

      the callback function

        • (): void
        • Returns void

    • Optional context: any

      the context for the callback function

    Returns void

unlisten

  • Stop listening to the other counter object

    Parameters

    • counter: Counter

      the counter object to stop listening to

    Returns void

Object literals

signals

signals: object

countChanged

countChanged: Signal<T> = new Signal()

Generated using TypeDoc