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

effector-logger breaks operations' priorities #100

Closed
yumauri opened this issue Jun 27, 2022 · 3 comments
Closed

effector-logger breaks operations' priorities #100

yumauri opened this issue Jun 27, 2022 · 3 comments
Labels
bug Something isn't working

Comments

@yumauri
Copy link

yumauri commented Jun 27, 2022

Subj, effector-logger somehow breaks effector priorities, for example, sample began to work earlier, than .on, which completely breaks synchronous logic.

Code

const passingBy = createEvent();
const goAhead = createEvent();
const $gate = createStore(true)
  .on(passingBy, () => false)
  .on(goAhead, () => true);

sample({
  clock: passingBy,
  target: goAhead
});

passingBy()

works differently, when you import from from "effector-logger":

  • with import {} from "effector" store $gate contains true after calculations
  • with import {} from "effector-logger" store $gate contains false after calculations, because sample executes earlier, than .on(passingBy

Repo with reproduce: https://github.com/yumauri/effector-logger-issue

@ZothOmmog
Copy link

Same problem
https://codesandbox.io/s/effector-logger-break-89zdmc?file=/src/App.js

@zerobias
Copy link
Member

Looks like an issue in effector-inspector
If you set inspector option to true (which is a default) the issue occurs

@yumauri
Copy link
Author

yumauri commented Jul 26, 2022

Yep, looks like. Might it be because inspector calls event inside of compute step?
https://github.com/effector/inspector/blob/master/src/index.ts#L235

UPD: I've tried to remove traceEffectRun/traceEventTrigger/traceStoreChange events calls (line 222, line 235 and line 260) from installed inspector in node_modules folder, and issue in my repo has gone. So, looks like here is an issue, or at least, roots lay here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants