Effect CommunityEC
Effect Community3y ago
6 replies
Stephen Bluck

Best Practices for Dealing with `Effect.Effect<R, E, void>`: `flatMap` or `Tap`?

What is considered best practise when dealing with an Effect.Effect<R, E, void> where the operation returns a
void
. Do you flatMap or do you Tap?

E.g.
Effect.tap((cookie) => Ref.update(cookies, HashMap.set(name, cookie)))

Vs
Effect.flatMap((cookie) => Ref.update(cookies, HashMap.set(name, cookie)))

Or does it not matter?
Was this page helpful?