-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
Changes:
- Loading branch information
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/** | ||
* Turns a parameterless function into an Iterator that will produce results using | ||
* the input function's return value. In case the function returns a promise, the result will be | ||
* an AsyncIterator. | ||
* Useful for 'impure' stuff like Math.random, or Date.now etc. | ||
* | ||
* @example | ||
* ```typescript | ||
* pipe( | ||
* itr8FromImpureFunction(Math.random), | ||
* take(3), | ||
* itr8ToArray | ||
* ); // => [0.2511072995514807, 0.04918679946517224, 0.48479881173432826] | ||
* ``` | ||
* @param a anything like object, string, number, ... | ||
* @returns an iterator | ||
* | ||
* @category interface/standard | ||
*/ | ||
declare function itr8FromImpureFunction<T>(f: () => T | Promise<T>): IterableIterator<T> | AsyncIterableIterator<T>; | ||
export { itr8FromImpureFunction }; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.