Skip to content
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

Memoize validation #3

Closed
erikras opened this issue Jul 31, 2015 · 9 comments
Closed

Memoize validation #3

erikras opened this issue Jul 31, 2015 · 9 comments

Comments

@erikras
Copy link
Member

erikras commented Jul 31, 2015

Look to reselect for inspiration.

@johanneslumpe
Copy link
Contributor

Haven't looked at reselect, but couldn't we just check whether the passed in data object is a new one? And if it's not just return the last error state.

@erikras
Copy link
Member Author

erikras commented Aug 4, 2015

I think so. I don't know if reselect is doing anything smarter than === or not.

@johanneslumpe
Copy link
Contributor

It seems that by default they do just that - ===. But they allow passing of a custom function. So maybe the first step could be to just use ===.

@erikras
Copy link
Member Author

erikras commented Aug 4, 2015

PRs accepted. ;-)

@johanneslumpe
Copy link
Contributor

I thought so ;) Will try to do something tomorrow morning :)

@johanneslumpe
Copy link
Contributor

@erikras sorry didn't have the time yet, did not forget about this!

@erikras
Copy link
Member Author

erikras commented Aug 12, 2015

I've decided that this is not in the scope of this project. It's the job of the person passing the validation function to memoize it. I've written a library called lru-memoize to enable this in react-redux-universal-hot-example.

@erikras erikras closed this as completed Aug 12, 2015
@johanneslumpe
Copy link
Contributor

Oh ok, also cool 👍

@lock
Copy link

lock bot commented Jun 3, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Jun 3, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants