Skip to content

Commit

Permalink
feat: support mapEffect
Browse files Browse the repository at this point in the history
  • Loading branch information
ppeeou committed Nov 25, 2024
1 parent 3c30c1e commit 208de20
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/Lazy/fx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,15 @@ class FxAsyncIterable<A> {
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<B>(f: (a: A) => B) {
return new FxAsyncIterable(map(f, this.asyncIterable));
}

/**
* Returns flattened AsyncIterable of values by running each element
* flattening the mapped results.
Expand Down Expand Up @@ -366,6 +375,15 @@ export class FxIterable<A> {
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<B>(f: (a: A) => B): FxIterable<B> {
return new FxIterable(map(f, this.iterable));
}

/**
* Returns flattened Iterable of values by running each element
* flattening the mapped results.
Expand Down

0 comments on commit 208de20

Please sign in to comment.