Hello,
I understand that if I want to have a persistent storage I have to create a reducer ( great example with theme ). This one can be extended in auth with a bearer token and that's great, no question on that side.
I want to understand which is the best approach for data that is not persistent and just in that session context ( until the app is closed ). I am not sure which pattern is "the best":
multiple reducers but not whiteListed for persistent ( create more "theme" like files )
a hard pattern that I don't understand with: createEntityAdapter + useSelector + RTK ( found this, but it is quite hard to follow https://github.com/reduxjs/redux-toolkit/discussions/3026 ). This one seems pretty interesting but quite hard to achieve and I am not sure if it gets harder as the app grows.
other ideas?
An example of what I want to achieve:
API call user login -> store bearer token in persistent store with it own reducer + store username in non-persistent store ( this part) -> I want to use the username and to get it easily to display on multiple screens.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Hello, I understand that if I want to have a persistent storage I have to create a reducer ( great example with theme ). This one can be extended in auth with a bearer token and that's great, no question on that side.
I want to understand which is the best approach for data that is not persistent and just in that session context ( until the app is closed ). I am not sure which pattern is "the best":
An example of what I want to achieve: API call user login -> store bearer token in persistent store with it own reducer + store username in non-persistent store ( this part) -> I want to use the username and to get it easily to display on multiple screens.
I will highly appreciate a code example