how can I expose the selectors used to create extraSelectors
with createFeature
?
#4292
Unanswered
naticaceres
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am working on a feature where I need to expose a raw version of the state along with a refined version of the state.
i.e. when creating a store for auth with a state as described below, I'd like to expose both
selectUser
(that is provided bycreateFeature
), andselectIsLoggedIn
(that is anextraSelector
derived fromselectUser
)this is what my code looks like:
the problem is,I cannot export
selectUser
bc it complains in thecreateFeature
function param aboutselectUser
being declared in an upper scope.my solution for now has been to redefine
selectUser
inextraSelectors
with a different name, and expose that.is there a big problem with this situation that I am missing, or is there a pattern I should be looking into to avoid this alltogether?
or else, what is the proper way to expose the raw feature selector along the extraSelectors derived from it?
edit1: reworded for clarity
Beta Was this translation helpful? Give feedback.
All reactions