Skip to content

Commit 014a952

Browse files
authored
Merge pull request #17 from floryst/clear-subs-share-data-set
fix(ShareDataSet): Stop data listener on unmount
2 parents 453538c + 01ab46e commit 014a952

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/core/ShareDataSet.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,13 @@ export default class ShareDataSet extends Component {
4646
return trivialProducer;
4747
}
4848

49+
componentWillUnmount() {
50+
if (this.subscription) {
51+
this.subscription.unsubscribe();
52+
this.subscription = null;
53+
}
54+
}
55+
4956
render() {
5057
this.update();
5158
return (

0 commit comments

Comments
 (0)