Effect CommunityEC
Effect Community2mo ago
7 replies
harrysolovay

Calling one `Atom.fn` inside another in TypeScript's Effect library

How best to call one Atom.fn inside of another? Something like the following?

const faAtom = Atom.fn<void>()(Effect.fn(function*() {
  // ...
}))

const fbAtom = Atom.fn<void>()(Effect.fn(function*(_, get) {
  const fa = get.fn(faAtom)
  const a = yield* fa()
}))


Or would something like this be an anti-pattern?
Was this page helpful?