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

.tap() before parameter do not respects existing befores #168

Open
Rulexec opened this issue Jan 4, 2022 · 1 comment
Open

.tap() before parameter do not respects existing befores #168

Rulexec opened this issue Jan 4, 2022 · 1 comment

Comments

@Rulexec
Copy link

Rulexec commented Jan 4, 2022

Hello. I have three plugins:

  • A depends on B
  • B depends on C
  • C

They tap some hook with same stage in the following order:

  • A, B, C

Then inside

_insert(item) {
they got position incorrectly as:

  • B, A, C

It happens because current logic looks like:

  • Adding A, no taps, just add
  • Adding B, B has before, so if (before.size > 0) allows to skip A and be inserted in the start of taps (e.g. order now is B, A)
  • Adding C to the top, since it has no before rules
@Rulexec
Copy link
Author

Rulexec commented Jan 4, 2022

Also it's will be good to throw exception if circular dependency is detected.

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

No branches or pull requests

1 participant