Repeat-Until
A simple utility to repeat a function until a truthy value is encountered.
Example Usage
This example will repeat the given function every 100ms until a truthy value is passed to the callback
as the second paremeter.
var repeatUntil = ; ;
Parameters
Example method call:
;
- delay - The number of ms to delay each function call for. The delay is applied before the first call to
taskFn
. - taskFn - The task to perform. It is passed one parameter
callback(err, stop)
. - finalFn - The function to call once repetition has finished or we've encountered an error.