Skip to content

Commit

Permalink
refator(video): guarantee connectStreams scope is valid
Browse files Browse the repository at this point in the history
The original debounce implementation (lodash) preserved the
caller's context - radash didn't, so it was failing and it wasn't noticed.

The new debounce implementation with the native function seems to preserve caller's context, but as a safety measure this commit binds the method to its appropriate scope.
  • Loading branch information
prlanzarin committed Aug 11, 2023
1 parent 25defd8 commit f3bd84e
Showing 1 changed file with 1 addition and 0 deletions.
Expand Up @@ -175,6 +175,7 @@ class VideoProvider extends Component {
this.onWsClose = this.onWsClose.bind(this);
this.onWsMessage = this.onWsMessage.bind(this);
this.updateStreams = this.updateStreams.bind(this);
this.connectStreams = this.connectStreams.bind(this);
this.debouncedConnectStreams = debounce(
this.connectStreams,
VideoService.getPageChangeDebounceTime(),
Expand Down

0 comments on commit f3bd84e

Please sign in to comment.