-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Description
Unable to reproduce myself, but Bugsnag reports this error several times a day on production, in node_modules/debounce-promise/dist/index.js:54:141:
Promise.resolve(options.accumulate ? fn.call(this, pendingArgs) : fn.apply(this, pendingArgs[pendingArgs.length - 1])).then(thisDeferred.resolve, thisDeferred.reject);
I believe it's some kind of race condition when the deferred object was already cleared.
We use ADP in React component like this:
fetch = async () => {
this.setState({fetching: true}, () => {
somethingAsync()
.then((data) => {
// setState(data)
this.debouncer = undefined
})
})
}
debounce = () => {
if (!this.debouncer) {
this.debouncer = AwesomeDebouncePromise(this.fetch, 500)
}
this.debouncer()
}
someActionCalledFromMultiplePlaces = () => {
this.debounce()
}
Metadata
Metadata
Assignees
Labels
No labels