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

Rule: no-call-of-derivative-events #3

Closed
igorkamyshev opened this issue Aug 28, 2021 · 4 comments
Closed

Rule: no-call-of-derivative-events #3

igorkamyshev opened this issue Aug 28, 2021 · 4 comments
Labels
enhancement New feature or request

Comments

@igorkamyshev
Copy link
Member

igorkamyshev commented Aug 28, 2021

Some events shouldn't be called in application:

  • Effect aware events — fx.doneDota, fx.done, etc.
  • Mapped events — const newEvent = oldEvent.map(..)
  • Store aware events $store.updates
  • Events created by methods — const event = sample({ source: $store, clock, fn })

But these events can be called:

  • const newEvent = event.prepend()
  • const { a, b } = createApi(store, {})
@igorkamyshev igorkamyshev added the enhancement New feature or request label Aug 28, 2021
@AlexandrHoroshih
Copy link
Member

AlexandrHoroshih commented Oct 26, 2021

Should be noted: split in shape like const cases = split(source, match) returns callable events - so not all events created by methods are fit to this rule

@igorkamyshev
Copy link
Member Author

@AlexandrHoroshih I don't understand, why? I thought these events will be executed when source and match suits?

@AlexandrHoroshih
Copy link
Member

Oops, i mixed up split with createApi

@sergeysova sergeysova changed the title Rule: no-call-of-derivative-events Rule: no-call-of-derivative-events Nov 9, 2021
@igorkamyshev
Copy link
Member Author

It will be covered by effector core and cannot be detected statically.

@igorkamyshev igorkamyshev closed this as not planned Won't fix, can't repro, duplicate, stale Jun 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants