effect: add Stream.filterMapEffectOption function
Type
- [ ] Refactor
- [x] Feature
- [ ] Bug Fix
- [ ] Optimization
- [ ] Documentation Update
Description
Adds a Stream.mapEffectFilter function that maps items of a stream effectfully,
and then filters them.
Related
- Closes #3018
⚠️ No Changeset found
Latest commit: b9b69acf33a72aed1f6107059328cc3bdac231d6
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
This PR includes no changesets
When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR
cc @tim-smart @IMax153 what do we think of the name?
cc @tim-smart @IMax153 what do we think of the name?
I'll be honest, I'm not a fan of this name. I find it confusing given there's also filterMapEffect.
That being said I don't have a good alternative at the moment 😬.
There are couple of alternatives I generated with AI: all feel as wrong IMO
https://sdk.vercel.ai/s/7HAZozu43jqI
Can we overload the predicate return type of filterMapEffect to be Option<Effect> | Effect<Option> I wonder.
The only case that could cause issues is if you return Option<Option>.
Can we overload the predicate return type of
filterMapEffectto beOption<Effect> | Effect<Option>I wonder.The only case that could cause issues is if you return
Option<Option>.
given Option is an Effect a union such as this would not be possible
Stream.filterMapEffectOption?
Stream.filterMapEffectOption?
let's go for this and re-think in 4.0 if we can have a single function
Yea I second Tim's suggestion - Stream.filterMapEffectOption is good for now 👍


apologies @Schniz I merged by mistake, needs to be re-opened given the lack of a changeset