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
I've noticed that the Selectors are all executed immediately and the results of them are provided to the React components for rendering. This means that it's difficult to have selectors that take parameters.
What I've taken to doing, which works but feels a bit strange, is having Selectors that return functions. For example:
So the React component sees two functions, one called selectUsers with zero parameter, and one called selectUserById with a single parameter. These can then be called as needed and will return the correct values from the state, but the actual execution of them is only on-demand and they can be parameterised.
I'm not sure if such a feature would be beneficial being included as a core part of redux-box, or how, but it would be useful for me :)
The text was updated successfully, but these errors were encountered:
I've noticed that the Selectors are all executed immediately and the results of them are provided to the React components for rendering. This means that it's difficult to have selectors that take parameters.
What I've taken to doing, which works but feels a bit strange, is having Selectors that return functions. For example:
So the React component sees two functions, one called
selectUsers
with zero parameter, and one calledselectUserById
with a single parameter. These can then be called as needed and will return the correct values from the state, but the actual execution of them is only on-demand and they can be parameterised.I'm not sure if such a feature would be beneficial being included as a core part of redux-box, or how, but it would be useful for me :)
The text was updated successfully, but these errors were encountered: