Effect CommunityEC
Effect Community2y ago
3 replies
youcef

Using `andThen` vs `flatMap` in Deferred examples

the docs have this example for how to use deferred:
import { Effect, Deferred } from "effect"
 
const effectDeferred = Deferred.make<string, Error>()
 
const effectGet = effectDeferred.pipe(
  Effect.andThen((deferred) => Deferred.await(deferred))
)

my question is, why use
andThen
at the end, instead of
flatMap
?
Was this page helpful?