Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Tracked by #841
artalar opened this issue May 20, 2024 · 2 comments
Labels
good first issue Good for newcomers

Comments

@artalar
Copy link
Owner

artalar commented May 20, 2024

@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)
@artalar artalar mentioned this issue May 20, 2024
13 tasks
@artalar artalar added the good first issue Good for newcomers label May 20, 2024
@BANOnotIT
Copy link
Collaborator

What syntax should I use to get value of an atom in "spied" environment like "computer" of an atom? peek(ctx, someAtom)?

@artalar
Copy link
Owner Author

artalar commented May 21, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants