@samitouri / QOS-React / commits / 0e235bb8f7

Removed unused state argument in unsubscribe method of <Subscription /> (#13233)

Mateusz Burzyński committed Jul 18, 2018 at 22:52 UTC 0e235bb8f78a4f9bac5ce74051de9c0fbb92eaca
1 file changed +3 -3
packages/create-subscription/src/createSubscription.js
+3 -3
@@ -87,13 +87,13 @@ export function createSubscription<Property, Value>(
87
88 componentDidUpdate(prevProps, prevState) {
89 if (this.state.source !== prevState.source) {
90 - this.unsubscribe(prevState);
90 + this.unsubscribe();
91 this.subscribe();
92 }
93 }
94
95 componentWillUnmount() {
96 - this.unsubscribe(this.state);
96 + this.unsubscribe();
97
98 // Track mounted to avoid calling setState after unmounting
99 // For source like Promises that can't be unsubscribed from.
@@ -147,7 +147,7 @@ export function createSubscription<Property, Value>(
147 }
148 }
149
150 - unsubscribe(state: State) {
150 + unsubscribe() {
151 if (typeof this._unsubscribe === 'function') {
152 this._unsubscribe();
153 }