Class AdvancedTimer<T>
Type Parameters
T = any
Hierarchy
- AdvancedTimer
Implements
Index
Constructors
Properties
Accessors
Methods
Constructors
constructor
Will construct a new advanced timer based on the options provided. Timer will not start until start() is called.
Type Parameters
T = any
Parameters
options: ITimerOptions<T>
construction options for this advanced timer
Returns AdvancedTimer<T>
Properties
on Each Count ObservableSearch playground for onEachCountObservable
Will notify each time the timer calculates the remaining time
on State Changed ObservableSearch playground for onStateChangedObservable
Will trigger when the timer state has changed
on Timer Aborted ObservableSearch playground for onTimerAbortedObservable
Will trigger when the timer was aborted due to the break condition
on Timer Ended ObservableSearch playground for onTimerEndedObservable
Will trigger when the timer ended successfully
Accessors
break Condition
set a breaking condition for this timer. Default is to never break during count
Parameters
predicate: ((data: ITimerData<T>) => boolean)
the new break condition. Returns true to break, false otherwise
Parameters
data: ITimerData<T>
Returns boolean
Returns void
Methods
clear ObservablesSearch playground for clearObservables
Reset ALL associated observables in this advanced timer
Returns void
disposeSearch playground for dispose
Dispose this timer, clearing all resources
Returns void
startSearch playground for start
Will start a new iteration of this timer. Only one instance of this timer can run at a time.
Parameters
Optional timeToEnd: number
how much time to measure until timer ended
Returns void
stopSearch playground for stop
Will force a stop on the next tick.
Returns void
An advanced implementation of a timer class