Platform: Ability to pass in custom memoization function for selectors

Created on 15 Jan 2018  路  6Comments  路  Source: ngrx/platform

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:

Store enhancement

Most helpful comment

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

All 6 comments

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

@roopkt I already have a branch in the works for this, but thanks! Could you take a look at https://github.com/ngrx/platform/issues/604? I believe you added the original functionality

hi @brandonroberts sure let me take a look thanks.

Very impressed! Great job!

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

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

axmad22 picture axmad22  路  3Comments

mappedinn picture mappedinn  路  3Comments

hccampos picture hccampos  路  3Comments

brandonroberts picture brandonroberts  路  3Comments

sandangel picture sandangel  路  3Comments