Skip to content

Commit

Permalink
added throttle cancel method (#39)
Browse files Browse the repository at this point in the history
  • Loading branch information
haritonasty authored and renatorib committed Apr 22, 2019
1 parent f9404d2 commit ec87f43
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/withSizes.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ const withSizes = (...mappedSizesToProps) => WrappedComponent => {
}

componentWillUnmount() {
this.throttledDispatchSizes.cancel()
window.removeEventListener('resize', this.throttledDispatchSizes)
}

Expand Down

0 comments on commit ec87f43

Please sign in to comment.