diff --git a/src/Lazy/fx.ts b/src/Lazy/fx.ts index 7ee8e164..a1cea15f 100644 --- a/src/Lazy/fx.ts +++ b/src/Lazy/fx.ts @@ -276,6 +276,16 @@ class FxAsyncIterable { return each(f, this.asyncIterable); } + /** + * Iterates over AsyncIterable, applying each in turn to `f`. + * It works the same way as `each`. + * + * see {@link https://fxts.dev/docs/each | each} + */ + async forEach(f: (a: A) => unknown): Promise { + return each(f, this.asyncIterable); + } + /** * Takes item from AsyncIterable and returns an array. * @@ -516,6 +526,7 @@ export class FxIterable { /** * Iterates over Iterable, applying each in turn to `f`. + * It works the same way as `forEach`. * * see {@link https://fxts.dev/docs/each | each} */ @@ -523,6 +534,16 @@ export class FxIterable { return each(f, this.iterable); } + /** + * Iterates over Iterable, applying each in turn to `f`. + * It works the same way as `each`. + * + * see {@link https://fxts.dev/docs/each | forEach} + */ + forEach(f: (a: A) => unknown): void { + return each(f, this.iterable); + } + /** * Takes item from Iterable and returns an array. *