Class: TimerManager
time-utilities/src.TimerManager
Manages timers so that this application can be cleanly exited
Hierarchy
any
↳
TimerManager
Constructors
constructor
• new TimerManager()
Inherited from
null.constructor
Properties
storedIntervals
▪ Static
Private
storedIntervals: Set
<Timeout
>
A set of intervals to clear on destroy
Defined in
projects/utilities/packages/time-utilities/src/lib/TimerManager.ts:13
storedTimeouts
▪ Static
Private
storedTimeouts: Set
<Timeout
>
A set of timeouts to clear on destroy
Defined in
projects/utilities/packages/time-utilities/src/lib/TimerManager.ts:8
Methods
clearInterval
▸ Static
clearInterval(interval
): void
Clears an internal created through this class
Parameters
Name | Type | Description |
---|---|---|
interval | Timeout | The interval to clear |
Returns
void
Defined in
projects/utilities/packages/time-utilities/src/lib/TimerManager.ts:55
clearTimeout
▸ Static
clearTimeout(timeout
): void
Clears a timeout created through this class
Parameters
Name | Type | Description |
---|---|---|
timeout | Timeout | The timeout to clear |
Returns
void
Defined in
projects/utilities/packages/time-utilities/src/lib/TimerManager.ts:34
destroy
▸ Static
destroy(): void
Clears running timeouts and intervals created through this class so NodeJS can gracefully exit
Returns
void
Defined in
projects/utilities/packages/time-utilities/src/lib/TimerManager.ts:63
setInterval
▸ Static
setInterval<A
>(fn
, delay
, ...args
): Timeout
Creates an interval gets cleared when destroyed
Type parameters
Name | Type |
---|---|
A | unknown |
Parameters
Name | Type | Description |
---|---|---|
fn | (...args : A []) => void | callback function |
delay | number | amount of time before running the callback |
...args | A [] | additional arguments to pass back to the callback |
Returns
Timeout
Defined in
projects/utilities/packages/time-utilities/src/lib/TimerManager.ts:45
setTimeout
▸ Static
setTimeout<A
>(fn
, delay
, ...args
): Timeout
Creates a timeout gets cleared when destroyed
Type parameters
Name | Type |
---|---|
A | unknown |
Parameters
Name | Type | Description |
---|---|---|
fn | (...args : A []) => void | callback function |
delay | number | amount of time before running the callback |
...args | A [] | additional arguments to pass back to the callback |
Returns
Timeout
Defined in
projects/utilities/packages/time-utilities/src/lib/TimerManager.ts:21