thecodingmachine / react-native-boilerplate

A React Native template for building solid applications πŸ™, using JavaScript πŸ’› or Typescript πŸ’™ (you choose).
https://thecodingmachine.github.io/react-native-boilerplate/
MIT License
4.75k stars 864 forks source link

[Help Wanted] Redux store best practices #383

Closed Tech-Dex closed 10 months ago

Tech-Dex commented 11 months ago

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

stale[bot] commented 10 months ago

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.