-
-
Notifications
You must be signed in to change notification settings - Fork 748
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
removeListener while executing events stops subsequent listeners from executing #2151
Comments
Noticed in espruino/BangleApps#1445 |
While fiddling around with the code I experienced the following behavior:
Returns:
Returns: The second emit seems to work as expected: The test function is removed and the reminding listener is called. |
Update ChangeLog and metadata.json - set version as alpha because of using espruino/Espruino#2151 Update README.md and settings.json - add oversize setting + description Update settings.js - add oversize setting - u Update widget.js - add oversize setting - add masking touch and drag input by adding own event listeners first and messing up the handler on a widget related event, using espruino/Espruino#2151
There might be some use cases where it could come in handy to prevent the subsequent listeners to get called. For example the lightswitch widget would be more usable on all apps (with enabled widgets) if touching the widget area could be masked out on the used app. Example code that masks the left 50px:
Maybe its not a bug, its a feature. 😅 I just build this into the lightswitch widget (as linked above) for testing and it works quiet nice. |
Update ChangeLog and metadata.json - set version as alpha due to the fact it is using a bug: espruino/Espruino#2151 Update README.md and settings.json - add oversize setting + description Update settings.js - add oversize setting Update widget.js - add oversize setting - add masking touch and drag input by adding own event listeners first and messing up the handler on a widget related event, using espruino/Espruino#2151
Update ChangeLog and metadata.json Update README.md and settings.json - add oversize setting + description Update settings.js - add oversize setting Update widget.js - add oversize setting - add masking touch and drag input by adding own event listeners first and messing up the handler on a widget related event, using espruino/Espruino#2151
lightswitch: masking (espruino/Espruino#2151) + oversize
Fixing this might help with the problem: #2559 |
Actually that doesn't help, but it's an easy fix.
|
Eg the code below:
Should print
A B C
but it only printsA B
.The text was updated successfully, but these errors were encountered: