Clarification on @effect/atom and @effect/atom-react Differences and Usage

Hi! Can someone please clarify some points on this package for me.
1. What's the difference between @effect/atom and @effect/atom-react. I noticed I use both in my codebase and everything is working fine.
2. What's the difference between creating atom with Atom.make and runtime.atom, besides the fact that runtime.atom takes an effect and provides services. Isn't runtime.atom just a superset of Atom.make?
3. Why we have runtime.atom(get => Effect.gen..., when we can just const registry = yield* RegistryProvider and then yield* registry.get?
4. Is there a way to await a Result? I am using Result.all to combine several results into one, but it would be handy to be able to do something like
export const openedPositionsAtom = runtime.atom((get) =>
  Effect.gen(function* () {
    const strategyId = get(strategySelectorAtom);
    const openedPositionsResult = get(openedPositionsAtomFamily(strategyId))
    const strategiesResult = get(strategiesAtom)
    const [strategies, openedPositions] = yield* Result.await([strategiesResult, openedPositionsResult]);
    
    return positions.flatMap((position) => {
        const strategy = strats.find(({id}) => id === position.strategyId)
        return strategy ? [{...position, strategyName: strategy.name}] : []
      })
  })
)
Was this page helpful?