Events apply should be FIFO
garex opened this issue · 4 comments
garex commented
// Native js
document.addEventListener('click', function() { console.log(1) })
document.addEventListener('click', function() { console.log(2) })
// jQuery
jQuery(document).click(function() { console.log(3) })
jQuery(document).click(function() { console.log(4) })
Result:
1
2
3
4
But in asEvented apply order is from last to first. This is confusing.
- Why did you choose such order -- LIFO?
- May be change it to FIFO?
mkuklis commented
@garex you are right. I'm not sure if this was intentional. I'm open for pull requests. Do you want to send one?
garex commented
@mkuklis ok, I will.
In the meantime you can setup tests in all popular browsers on travis+sause combination.
Pls see this project as example: https://github.com/garex/angular-sorted-map