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
Inside the unsubscribe function, the code is
unsubscribe
var subs = cache[callback ? handle : handle[0]], callback = callback || handle[1], len = subs ? subs.length : 0;
In case a callback is passed,
callback
subs
undefined
cache
The final check then...
if (subs[len] === callback) { // undefined[0] => always false subs.splice(len, 1); }
...doesn't result in anything getting spliced from subs.
Please help me see the reason behind having callback as param if I have minsunderstood the code.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Inside the
unsubscribe
function, the code isIn case a
callback
is passed,subs
becomesundefined
because an array is being passed to thecache
object.callback
local variable holds the passed incallback
The final check then...
...doesn't result in anything getting spliced from
subs
.Please help me see the reason behind having
callback
as param if I have minsunderstood the code.The text was updated successfully, but these errors were encountered: