In some edge cases we are using subscribe function only to inject props, yet not for subscribing it to the state. In those cases we aren't passing by mapStateToProps.
Despite we consider it an anti-pattern, because we could simply compose the component in order to achieve that, it will be a improvement to not execute all the subscription flow if no mapStateToProps is passed by in the subscribe function.
Now we are passing by an empty fucntion:
subscribe(Component, () => {}, { myInjectedPropr: 'Hi there' });
This should allow to do this:
subscribe(Component, null, { myInjectedPropr: 'Hi there' }`);
In some edge cases we are using
subscribefunction only to inject props, yet not for subscribing it to the state. In those cases we aren't passing by mapStateToProps.Despite we consider it an anti-pattern, because we could simply compose the component in order to achieve that, it will be a improvement to not execute all the subscription flow if no
mapStateToPropsis passed by in thesubscribefunction.Now we are passing by an empty fucntion:
This should allow to do this: