Throttler
Constructor Summary
Public Constructor | ||
public |
constructor(throttleDelay: Number, shouldQueue: Boolean, actionContext: Object, useTicks: Boolean): Throttler |
Member Summary
Public Members | ||
public |
|
|
public |
delay: * |
|
public |
|
|
public |
queue: * |
|
public |
shouldQueue: * |
|
public |
timer: * |
Method Summary
Public Methods | ||
public |
Adds an executable action to the queue that will be executed consecutively by the Throttler. |
Public Constructors
public constructor(throttleDelay: Number, shouldQueue: Boolean, actionContext: Object, useTicks: Boolean): Throttler source
Params:
Name | Type | Attribute | Description |
throttleDelay | Number | Minimum amount of time in between each action executed by the Throttler, in milliseconds or ticks. |
|
shouldQueue | Boolean | Enable if each added action should be executed consecutively, or disable if a newly added action should replace a previous one. |
|
actionContext | Object | Context to which the actions executed by the Throttler will be bound. |
|
useTicks | Boolean | whether ticks should be used instead of milliseconds |
Public Members
public actionContext: * source
public delay: * source
public executionTimer: * source
public queue: * source
public shouldQueue: * source
public timer: * source
Public Methods
public add(action: Function): void source
Adds an executable action to the queue that will be executed consecutively by the Throttler. If Throttler was constructed with shouldQueue = false, adding a new action will remove the old one.
Params:
Name | Type | Attribute | Description |
action | Function | Function to execute. |
Return:
void |