Skip to content

[Experimental] Support custom isEqual function for selectors #15

@captbaritone

Description

@captbaritone

As called out in reduxjs/react-redux#2263

Rather than supporting isEqual directly I'd like to explore passing the selector the current and previous values. This would allow libraries like Relay to implement recycleNodesInto which allows selectors which are pure functions to end up returning objects which implement structural sharing, which is important for keeping memoization in React happy. (Example, your selector returns a nested object and a state change causes you to return a new top level field, but the nested items have all the same values. This allows you to keep stable object identity for those nested objects.

I think this can be used to implement a custom isEqual.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions