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

Ability to pass in custom memoization function for selectors #724

Closed
alex-okrushko opened this issue Jan 15, 2018 · 6 comments
Closed

Ability to pass in custom memoization function for selectors #724

alex-okrushko opened this issue Jan 15, 2018 · 6 comments

Comments

@alex-okrushko
Copy link
Member

I'm submitting a...


[x] Feature request

What is the current behavior?

Currently the hardcoded memoization is instance equality check, which doesn't work well with arrays.

e.g. I have an array that changes on certain actions and there are many selectors for this data. Some/most selectors return the same items, but because it's a new array all the selector changes are needlessly triggered.

reselect has createSelectorCreator for that purpose.

Expected behavior:

Minimal reproduction of the problem with instructions:

Version of affected browser(s),operating system(s), npm, node and ngrx:

Other information:

@rupeshtiwari
Copy link
Contributor

Hi @brandonroberts ,
Do you want me to work on this enhancement ?

@brandonroberts
Copy link
Member

@roopkt I already have a branch in the works for this, but thanks! Could you take a look at #604? I believe you added the original functionality

@rupeshtiwari
Copy link
Contributor

hi @brandonroberts sure let me take a look thanks.

@alex-okrushko
Copy link
Member Author

Very impressed! Great job!

@rupeshtiwari
Copy link
Contributor

Hi @brandonroberts
I am sorry I was completely absorbed in my office project did not get time to work on it.

@bene-starzengruber
Copy link

bene-starzengruber commented Jan 25, 2019

This is amazing, but it's very hard to find!
It should definitely be included into the NgRx docs with examples:
https://ngrx.io/guide/store/selectors

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

No branches or pull requests

5 participants