// // Copyright 2025 DXOS.org // import * as Atom from '@effect-atom/atom/Atom'; import type { Ref } from './ref'; import { loadRefTarget } from './utils'; /** * Atom family for ECHO refs. * Uses ref reference as key — same ref returns same atom. * This atom only updates once when the ref loads — it does not subscribe to target object changes. * Use `Obj.atom(ref)` if you need reactive snapshots of ECHO objects via a ref. */ export const refSimpleFamily = Atom.family((ref: Ref): Atom.Atom => { return Atom.make((get) => { return loadRefTarget(ref, get, (target) => target); }); });