Odonno / ReduxSimple

Simple Stupid Redux Store using Reactive Extensions
http://www.nuget.org/packages/ReduxSimple/
MIT License
144 stars 20 forks source link

Confusing names for "Memoized selectors" #68

Closed ltjax closed 4 years ago

ltjax commented 4 years ago

Hello. Thanks for this nice library!

I think the wording for "Memoized selectors" is a bit confusing. Normally, memoization is a caching technique used for optimization. See, e.g., wikipedia. The docs here seem to describe something that is more like a concatenation/composition of selectors. Note that JS's reselect does both: memoization and composition. Maybe the selectors already do memoization, but I don't see why only the composed ones would, as it appears in the readme.

Odonno commented 4 years ago

Hi @ltjax

The memoized selectors I made are based on the DistinctUntilChanged operator of Rx.NET. I believe it works like it would. If there are some cases that do not respect this memo pattern, please let me know.

And, about that composition thing, I don't follow. I believe they are composed by deriving from the state or from other selectors. It is what is done in @ngrx selectors. But it may not follow the exact same pattern. If you can clarify your thoughts on this, it would a pleasure to fix any undesired effect.

Thank you.

Odonno commented 4 years ago

Oh, I just read the readme and I understand your confusion. I explicitly call them memoized selectors when indeed all selectors are memoized by design. If that's the issue, I will update the readme to be clear.

ltjax commented 4 years ago

Yes, that is what I meant. Just call the whole section "memoized selectors", and I'm good 👍

Odonno commented 4 years ago

Done. What do you think now?

ltjax commented 4 years ago

Perfect! Thanks