If the storage data changes, will those changes be loaded?
See original GitHub issueI’m using this with react-native. I have a background task that loads up the store and runs some data fetching. My question is: will the updated data be loaded automatically by redux-persist when the app comes back into the foreground? If the app was killed, the data will be loaded by nature of initializing the store. My concern is for when the app is open in the background and execution of JS is paused. I’m concerned that when the app is pulled into the foreground, the state stored in the foreground will overwrite the changes that occurred in the background. I’m thinking I might need to do persistor.pause()
when the app goes into the background and persistor.persist()
when the app comes into the foreground. Does persistor.persist()
re-load the state from storage?
Issue Analytics
- State:
- Created 4 years ago
- Comments:5
I started by using
react-native-background-task
but bailed on it after I noticed this:I’ve used TransistorSoft’s work before. It’s quality. I would recommend using
react-native-background-fetch
directly.@timhuff The snippet’s really helpful -
react-native-background-task
is just a wrapper aroundreact-native-background-fetch
. I didn’t think just using the created store from the foreground could be possible in the background. Thanks!