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

LIFO instead of FIFO #18

Closed
ronag opened this issue Jul 9, 2016 · 3 comments
Closed

LIFO instead of FIFO #18

ronag opened this issue Jul 9, 2016 · 3 comments

Comments

@ronag
Copy link

ronag commented Jul 9, 2016

It would be great if the calling order was LIFO (same as stack unwinding) instead of, how it is now, FIFO.

It could easily be accomplished by replacing push with unshift.

@dougwilson
Copy link
Contributor

This is a duplicate of #17 . This module will only run in the same order as even listeners, mainly because we are attaching event listeners. That internal array is just so if you use this module a lot on the same object, you won't get the too many event listeners warning. Ultimately, the order is only that of event listeners. You're welcome to publish your own module that goes in reverse, of course. I don't see why there cannot be a LIFO module and a FIFO module. At the very least, I wrote everything around the order this module works, so changing it is just not negotiable, I'm sorry.

If you publish another module,I can link to it in the readme as an alternative.

@ronag
Copy link
Author

ronag commented Jan 26, 2017

@ggoodman
Copy link

ggoodman commented Dec 7, 2017

I've submitted a PR for optional LIFO ordering in #28.

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

3 participants