Skip to content

Commit

Permalink
refactor: bind this only once per component instance
Browse files Browse the repository at this point in the history
  • Loading branch information
bill-min committed Jan 8, 2024
1 parent d556763 commit 477148d
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,14 @@ export = {
loading,
err: undefined,
};

this.handleSrcChange = this.handleSrcChange.bind(this);
},
onInput(input) {
if (this.from !== input.from) {
this.from = input.from;
this.streamSource = getSource(input.from);
if (!input.noRefresh) {
this.handleSrcChange = this.handleSrcChange.bind(this);
this.streamSource.onInvalidate(this.handleSrcChange);
}
}
Expand Down

0 comments on commit 477148d

Please sign in to comment.