Using Effect with Nested Async Callbacks

How do i use effect with a promise that takes an async callback. for e.x.

Effect.gen(function(_) {
  yield* _(Effect.tryPromise(async () => myFunction("aaa", async () => Effect.tryPromise(...).pipe(Effect.runPromise) )))
})


the nested promise in the callback is in a different scope which breaks everything in term of collecting telemetry, scope, etc...
Was this page helpful?