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
When attempting to cancel the onchange event listener on my svelte store.
let handler = store.onchange(storeChanged); handler.cancel();
I kept receiving the following error:
TypeError: this._changeHandlers is undefined
This is due to the scope of the returned object which contains the cancel() function not having a reference to the changeHandlers array.
The workaround in code that I did for this was the following, which I suspect is not what you want the user to have to do.
handler.cancel.bind(store)()
I've written a pull request to fix this, which binds the cancel() function to this, in order to maintain the reference to this._changeHandlers.
return { cancel: function() { var index = this._changeHandlers.indexOf(callback); if (~index) this._changeHandlers.splice(index, 1); }.bind(this) };
The text was updated successfully, but these errors were encountered:
Released 1.55.1 with the fix, thank you!
Sorry, something went wrong.
No branches or pull requests
When attempting to cancel the onchange event listener on my svelte store.
I kept receiving the following error:
TypeError: this._changeHandlers is undefined
This is due to the scope of the returned object which contains the cancel() function not having a reference to the changeHandlers array.
The workaround in code that I did for this was the following, which I suspect is not what you want the user to have to do.
handler.cancel.bind(store)()
I've written a pull request to fix this, which binds the cancel() function to this, in order to maintain the reference to this._changeHandlers.
The text was updated successfully, but these errors were encountered: