How to inject a dependency initialized based on a state value #2052
Closed
omaralbeik
started this conversation in
General
Replies: 1 comment 2 replies
-
Have a read through #1969. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
First, as usual thank you for the great work 👏👏👏
I’m working on an app where I need to override a dependency based on a state value, the dependency will be used in a child reducer later on.
I don't know how and when to initialize the dependency
Here’s a quick example:
Imagine a simple app that consists of the following service and three modules
Book service
A service required to fetch book titles for a given user:
Unauthenticated feature
Unauthenticated user logic, eg. login, register, forget password, and all features related to signing in a user:
Authenticated feature
All logic related to the authenticated user:
Main
The main module that loads when the app lunches, determines what flow to continue with based on authentication state.
Beta Was this translation helpful? Give feedback.
All reactions