lets assume something lile this:
handleClick = () => {
dispatchThunkAction(this.someMethod),
}
someMethod = () => {
//do something
}
dispatchThunkAction
fires http request.
once done, thunk action calls back someMethod
thats passed to it.
should someMethod
be set to null
in componentWiUnmount
for the case unmount happens in the middle of http (or any other async operation) call?
so, like
componentWillUnmount() {
this.someMethod = null;
}
so that garbage collector knows it can pick it up immediately.