Skip to content

Commit

Permalink
Merge pull request #17 from floryst/clear-subs-share-data-set
Browse files Browse the repository at this point in the history
fix(ShareDataSet): Stop data listener on unmount
  • Loading branch information
jourdain authored Jul 8, 2021
2 parents 453538c + 01ab46e commit 014a952
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/core/ShareDataSet.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,13 @@ export default class ShareDataSet extends Component {
return trivialProducer;
}

componentWillUnmount() {
if (this.subscription) {
this.subscription.unsubscribe();
this.subscription = null;
}
}

render() {
this.update();
return (
Expand Down

0 comments on commit 014a952

Please sign in to comment.