You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Consider creating curried selectors with data-last args #490
When using createSelector factory, we receive selector function accepting state first and searchKey last. (* I don't know how searchKey arg is called in sources)
This gets cumbersome quickly, having to repeat still the same boilerplate code as an input to useSelector.
We have to repeat the pattern of STATE => selector(STATE, searchKey) all over!
Creating curried selector accepting args in reversed order can provide cleaner API, achieving the same results with less code and even support better memoization or various functional composition...
constselector=(searchKey)=>(state)=>result;
Having this, now we could simplify the code above to the following:
Activity