Skip to content
Discussion options

You must be logged in to vote

we can't just return nil because that's an invalid mapping.

Instead of map, you can use Combine's compactMap, which lets you filter out nil outputs in the closure. Just make sure you call .eraseToEffect() on the publisher it returns to get things back in an Effect.

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@yspreen
Comment options

Answer selected by yspreen
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants