Starts the timer interval. Calling start() while reissue is already active will throw an exception.
delay
Number? an optional delay in ms before first invocation. if no delay is provided, first invocation is synchronous (no setImmediate, no setTimeout). Note that0
is explicitly a valid value, and will be passed to setTimeout.
Returns undefined
Stops the interval execution, and clears any queued up invocations.
Returns undefined
This module exposes a create method which takes the following options:
opts
Object an options objectopts.func
Object the function to execute on an interval. this function is invoked with a callback function as its last parameter.opts.interval
Number the interval in ms to execute the function, or a function that returns an interval, allowing usage of a dynamic interval.opts.timeout
Number? an optional timeout in ms. if any invocation of the the supplied func exceeds this timeout, thetimeout
event is fired.opts.context
Object? an optionalthis
context for the function invocation. use this in lieu of nativebind()
if you are concerned about performance. reissue usesapply()
under the hood to do context/arg binding.opts.args
Array? an optional array of arguments for the function. used in conjunction with the sameapply()
call as the context.
Returns Reissue a Reissue object