diff --git a/src/Lazy/fx.ts b/src/Lazy/fx.ts index f7f511e2..ac8a1a34 100644 --- a/src/Lazy/fx.ts +++ b/src/Lazy/fx.ts @@ -66,6 +66,15 @@ class FxAsyncIterable { return new FxAsyncIterable(map(f, this.asyncIterable)); } + /** + * A function that is identical to `map`, but is intended to create side effects as part of its convention. + * + * see {@link https://fxts.dev/docs/map | map} + */ + mapEffect(f: (a: A) => B) { + return new FxAsyncIterable(map(f, this.asyncIterable)); + } + /** * Returns flattened AsyncIterable of values by running each element * flattening the mapped results. @@ -366,6 +375,15 @@ export class FxIterable { return new FxIterable(map(f, this.iterable)); } + /** + * A function that is identical to `map`, but is intended to create side effects as part of its convention. + * + * see {@link https://fxts.dev/docs/map | map} + */ + mapEffect(f: (a: A) => B): FxIterable { + return new FxIterable(map(f, this.iterable)); + } + /** * Returns flattened Iterable of values by running each element * flattening the mapped results.