Class: Gatekeeper

Gatekeeper(nameopt, keyopt, cacheObjopt)

Class that implements the Gatekeeper design pattern. When the user calls addCommand, it will queue them up so that a new command is not called until the time specified by the previous command has passed.

Constructor

new Gatekeeper(nameopt, keyopt, cacheObjopt)

Creates the Gatekeeper
Parameters:
Name Type Attributes Description
name string <optional>
name of the Gatekeeper (used for the timer)
key string <optional>
key for the backing map in the cache
cacheObj object <optional>
cache object to use (defaults to cache.private if key is provided)
Source:

Methods

addCommand(a, a)

Add a command to the queue of commands. Gatekeeper will wait until pause before it will call the next command in the queue.
Parameters:
Name Type Description
a * date time or duration supported by time.toZDT
a function funuction to call
Source:

cancel()

Cancels all queued commands. Redundant with cancelAll() to make it easier to use with Blockly.
Source:

cancelAll()

Cancels all queued commands.
Source: