Open Flamenco opened 6 months ago
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.
let fn = ()=>{
item.off('update', fn);
};
item.on('update', fn);
item.off('update', fn);
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.