We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Describe the bug A clear and concise description of what the bug is.
Observable.once creates a wrapper around the function, so calling Observable.off does not prevent it from being called.
Observable.once
Observable.off
let fn = ()=>{}; item.once('update', fn); item.off('update', fn);
fn, will still be invoked under this scenario.
fn
This seems to by design, so it should be documented that off will not prevent once from being called.
off
once
The text was updated successfully, but these errors were encountered:
Update observable.js
8960fdb
Fixes dmonad#86
As a workaround, the callback function can use on and then remove itself when invoked, in order to be both callable once, and also removable.
on
let fn = ()=>{ item.off('update', fn); }; item.on('update', fn); item.off('update', fn);
Sorry, something went wrong.
dmonad
No branches or pull requests
Describe the bug
A clear and concise description of what the bug is.
Observable.once
creates a wrapper around the function, so callingObservable.off
does not prevent it from being called.fn
, will still be invoked under this scenario.This seems to by design, so it should be documented that
off
will not preventonce
from being called.The text was updated successfully, but these errors were encountered: