Open artalar opened 4 months ago
What syntax should I use to get value of an atom in "spied" environment like "computer" of an atom? peek(ctx, someAtom)
?
@BANOnotIT I will add read(ctx, cb)
, where the callback could be an atom. Im still not sure about the naming, proposals are accepted :)
@artalar will change the runtime behaviour of the atom, but we need codemod, or the eslint fix feature which will make this changes:
ctx.spy(anAtom)
->anAtom(ctx)
ctx.get(anAtom)
->anAtom(ctx)
ctx.spy(anAtom, cb)
->import { spy } from "@reatom/framework"; ... spy(ctx, anAtom, cb)
ctx.get(cb)
->import { batch } from "@reatom/framework"; ... batch(ctx,cb)