artalar / reatom

Reatom - the ultimate state manager
https://reatom.dev
MIT License
991 stars 105 forks source link

Deprecate `ctx.get`, `ctx.spy`, and allow calling an atom with one "ctx" argument for reading and tracking. #844

Open artalar opened 4 months ago

artalar commented 4 months ago

@artalar will change the runtime behaviour of the atom, but we need codemod, or the eslint fix feature which will make this changes:

BANOnotIT commented 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)?

artalar commented 4 months ago

@BANOnotIT I will add read(ctx, cb), where the callback could be an atom. Im still not sure about the naming, proposals are accepted :)