question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

If the storage data changes, will those changes be loaded?

See original GitHub issue

I’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:closed
  • Created 4 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
timhuffcommented, Aug 5, 2019

I started by using react-native-background-task but bailed on it after I noticed this:

image

I’ve used TransistorSoft’s work before. It’s quality. I would recommend using react-native-background-fetch directly.

0reactions
Li357commented, Aug 5, 2019

@timhuff The snippet’s really helpful - react-native-background-task is just a wrapper around react-native-background-fetch. I didn’t think just using the created store from the foreground could be possible in the background. Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Incremental refresh for datasets and real-time data in Power BI
Refresh operations must also rely on volatile connections to data sources, and the ability of those data source systems to quickly return query ......
Read more >
LocalStorage, sessionStorage - The Modern JavaScript Tutorial
The localStorage is shared between all windows with the same origin, so if we set the data in one window, the change becomes...
Read more >
Change Data Capture (CDC): What it is and How it Works
It provides an accurate view of changed data while only using native SQL scripts. Disadvantage of this approach: Demand for storage significantly increases ......
Read more >
How your Google storage works - Google One Help
Each Google Account includes 15 GB of storage, which is shared across Gmail, Google Drive, and Google Photos. To add to your storage...
Read more >
Data Storage Considerations - Snowflake Documentation
Storage is calculated and charged for data regardless of whether it is in the Active, Time Travel, or Fail-safe state. Because these life-cycle...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found