Skip to content

FEATURE REQUEST: Accept object as a valid mapStateToProps argument #644

Closed
@josepot

Description

@josepot

I think that it would be very convenient to accept an object as a valid mapStateToProps argument. In which case, each function inside it would be assumed to be a Redux selector.

I always use reselect and I would love to be able to do:

connect({
  foo: fooSelector,
  bar: barSelector,
})

instead of doing the verbose:

connect(createStructuredSelector({
  foo: fooSelector,
  bar: barSelector,
})

I know that this is just sugar, but I think that it would be very convenient. In the same way that I love the fact that I can pass an object with action-creators as a valid mapDispatchToProps argument, I would like to be able to pass an object with selectors in the mapStateToProps argument.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions