Skip to content

Avoid run all the subscription flow for components not passing mapStateToProps as argument #4

Description

@mariosanchez

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' }`);

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions