Skip to content

Adds memoize option, defaulting to no memoization #180

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

tgriesser
Copy link
Contributor

So ultimate goal of #179 was to be able to add a layer of memoization on the selector - this PR does just that, if there is a function provided as a memoize option, the selector is passed through that function at instantiation and attached to the component instance. If memoize option is not provided the default is identity the function is attached directly to the component.

I moved a bit of the construction of the class to componentWillMount so we have a method to call in componentWillUpdate to re-attach the functions on hot reloading.

@tgriesser
Copy link
Contributor Author

Actually, this approach doesn't work either because it uses the same function for both mapState and mapDispatch, reopening #179.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant