UNPKG

416 BJavaScriptView Raw
1import rejectAfterBy from './rejectAfterBy.js';
2
3/**
4 * Returns a function that returns a Promise that rejects with the results of a callback.
5 *
6 * @function rejectBy
7 * @category Higher-order
8 *
9 * @arg {function} [callback] - Context and args are set to the same as those passed to the initially returned function.
10 *
11 * @returns {function(): Promise}
12 */
13export default (callback) => rejectAfterBy(0, callback);