-
Notifications
You must be signed in to change notification settings - Fork 1
fromInvocation
Subhajit Sahu edited this page Feb 3, 2021
·
1 revision
Generate iterable from repeated function invocation.
Alternatives: from, fromIterator, fromRange, fromInvocation, fromApplication.
Similar: toInvokable, fromInvocation.
function fromInvocation(fn, ...args)
// fn: function (impure)
// args: arguments
const xiterable = require('extra-iterable');
var x = xiterable.fromInvocation(Math.random);
[...xiterable.take(x, 4)];
// → [
// 0.9563611116619364,
// 0.9938159365212336,
// 0.38494305694810205,
// 0.06828624643528514
//]