Effect CommunityEC
Effect Communityβ€’2y agoβ€’
17 replies
RJ

Trouble Unifying Types in TypeScript with `Effect.timeoutTo` Usage

I'm having some trouble unifying the result of applying

Effect.timeoutTo({
  duration: Duration.seconds(10),
  onSuccess: Option.some,
  onTimeout: Option.none,
})


to an Effect<A>. I'm getting

Option.Option<never> | Option.Option<A>


when of course I'd just like

Option.Option<A>


Maybe Unify.unify could solve this somehow? But I haven't figured out how.
Was this page helpful?