-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Description
Debounced SDK methods lose this context, causing runtime errors when the SDK tries to access instance properties.
Steps to Reproduce
const debounced = debouncePromise(localitiesService.search, 100);
debounced(request); // TypeError: undefined is not an object (evaluating 'this.sessionId')Proposed Fix
Wrap in arrow function to preserve context:
this.debouncedLocalitiesSearch = debouncePromise(
(request) => localitiesService.search(request),
100
);Or update debouncePromise to use fn.apply(this, args) instead of fn(...args).
Or bind the method like.
const debounced = debouncePromise(localitiesService.search.bind(localitiesService), 100);
debounced(request).then(...);Map JS Doc need to be updated too
manz
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working