This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Optional `options. Stuff like retry count, ramp-up, etc. | |
// should have sane defaults. | |
var wait = waitforit(options, function (cb) { | |
// This would be the 'test' function. | |
// cb(true) when 'it' is done. | |
}); | |
wait.on('ready', function () { | |
// Do something because the test condition passed. | |
}); | |
wait.on('timeout', function () { | |
// We got past the max retries or max total time or w/e. | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment