You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A bean.one(elm, type, handler) handler cannot itself invoke bean.one with the same element, type and function. Here's an example where I listen for one mousemove event, and in the handler decide to listen for another mousemove event, but the handler never comes along.
Result: my handler is called only for the first mousemove event
Expected: my handler should be called every time there is a mousemove event, since I explicitly listened to it again.
I figured out a workaround, which is to listen to a copy of the function. That produces the same effect because the copy !== the original function.
soooo .. unfortunately I don't have a whole lot of time to address this myself and since this doesn't impact me it's difficult to prioritise it. I know this isn't what you want to hear but if you could have a go at trying a fix and submitting a pull request then that'd get you much further.
A
bean.one(elm, type, handler)
handler cannot itself invokebean.one
with the same element, type and function. Here's an example where I listen for onemousemove
event, and in the handler decide to listen for anothermousemove
event, but the handler never comes along.http://jsbin.com/hobaya/1/edit?html,js,output
Result: my handler is called only for the first mousemove event
Expected: my handler should be called every time there is a mousemove event, since I explicitly listened to it again.
I figured out a workaround, which is to listen to a copy of the function. That produces the same effect because the copy
!==
the original function.http://jsbin.com/fosuvi/1/edit?html,js,output
Alternatively, using setImmediate or setTimeout to move the
one()
call outside the call stack that resulted in calling the handler also works.http://jsbin.com/fepada/1/edit?html,js,output
The text was updated successfully, but these errors were encountered: