diff options
Diffstat (limited to 'lib/until.js')
-rw-r--r-- | lib/until.js | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/lib/until.js b/lib/until.js index 7b0b0b5..942a381 100644 --- a/lib/until.js +++ b/lib/until.js @@ -1,9 +1,9 @@ import whilst from './whilst'; /** - * Repeatedly call `fn` until `test` returns `true`. Calls `callback` when + * Repeatedly call `iteratee` until `test` returns `true`. Calls `callback` when * stopped, or an error occurs. `callback` will be passed an error and any - * arguments passed to the final `fn`'s callback. + * arguments passed to the final `iteratee`'s callback. * * The inverse of [whilst]{@link module:ControlFlow.whilst}. * @@ -14,17 +14,16 @@ import whilst from './whilst'; * @see [async.whilst]{@link module:ControlFlow.whilst} * @category Control Flow * @param {Function} test - synchronous truth test to perform before each - * execution of `fn`. Invoked with (). - * @param {Function} fn - A function which is called each time `test` fails. - * The function is passed a `callback(err)`, which must be called once it has - * completed with an optional `err` argument. Invoked with (callback). + * execution of `iteratee`. Invoked with (). + * @param {AsyncFunction} iteratee - An async function which is called each time + * `test` fails. Invoked with (callback). * @param {Function} [callback] - A callback which is called after the test - * function has passed and repeated execution of `fn` has stopped. `callback` - * will be passed an error and any arguments passed to the final `fn`'s + * function has passed and repeated execution of `iteratee` has stopped. `callback` + * will be passed an error and any arguments passed to the final `iteratee`'s * callback. Invoked with (err, [results]); */ -export default function until(test, fn, callback) { +export default function until(test, iteratee, callback) { whilst(function() { return !test.apply(this, arguments); - }, fn, callback); + }, iteratee, callback); } |