Defines a new condition check function that will terminate a running Watcher after its next step, if the check function returns false
Optional
cfg: BecauseConfigDefines a new callback function that runs when a Watcher is started
Optional
cfg: BeginConfigDirectly adjust all of the internal state of a Watcher
Optional
cfg: WatcherConfigDefines a callback function that runs on every step the Watcher takes
Optional
cfg: DoConfigDefines how often the Watcher should run its associated callbacks
Optional
cfg: EveryConfigStarts the current set of configured behaviors
True if the Watcher was started
Stops the current set of configured behaviors
True if the Watcher was stopped
Defines a new condition check function that will terminate a running Watcher before its next step, if the check function returns true
Optional
cfg: UnlessConfigDefines a new condition check function that will terminate a running Watcher after its next step, if the check function returns true
Optional
cfg: UntilConfigDefines a new condition check function that will terminate a running Watcher before its next step, if the check function returns false
Optional
cfg: WhileConfig
A Watcher is a configurable system to run callback functions. They are primarily designed to work with intermittent or otherwise limited duration activities.
Watchers use a combination of
setInterval
andsetTimeout
to control the frequency and time span in which they operate. Watchers provide a chainable syntax as well as the ability to pass optional configuration objects to allow adjustments to be made over time.Timeline of Watcher behaviors:
.start()
.begin()
.every()
ms for.for()
ms, or until.stop()
:.unless()
,.while()
.do()
.until()
,.because()
.end()