Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In a react native app, when will the redux store get cleared?

I want to know how and when the redux store gets cleared in a react native app. Does it get cleared when the app close? Does it get cleared when the user clear it from running apps? Or does it clear only when I uninstall the app?

like image 393
THpubs Avatar asked Dec 25 '16 12:12

THpubs


Video Answer


1 Answers

Depends. Redux just creates an object (the store) which is kept alive as long as the JavaScript runs (that means, if you close the app, the store object will be deleted and all information lost). However, if you use a persistence layer on top of redux, say, redux-persist, your data will be stored in the persistant storage of the application, which gets cleared once you either uninstall the application or, in the Android case, also when you clear the application data.

like image 108
martinarroyo Avatar answered Nov 04 '22 04:11

martinarroyo