Skip to content

Selector with props does not make sense when defaultMemoize has cache size = 1 #66

@compulim

Description

@compulim

Assumption:

  • A component that appears on a page multiple times
  • The component use ReactRedux.connect and reselect to select data based on state and component.props

Problem:
If the page have two or more component instances and their props are different, the memoize function (which has cache size = 1) will always cache miss.

This is because the memoize function is shared amongst all component instance, thus, component with different props will always invalidate each other.

Solution:
There are multiple solutions to this issue. I think memoize cache should bound to the component instance.

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