tbo
tbo

Reputation: 9758

Offline mode in React

I have a use case where we need to have an application which will operate in the user's pc in an offline mode, the user will do stuff and save then and at the end of the day, when she/he goes back to the office and enters the local network will be able to connect, authenticate and push/save the work done.

I'm wondering whether is this possible with React framework, to work in an offline mode somehow and submit the work when the user reaches network? Maybe something like swarm? http://swarmjs.github.io/articles/todomvc/

I can install something like a client side application in the user's laptop/pc but is there any react way to sync local store or something similar with the server?

Upvotes: 3

Views: 3166

Answers (2)

Dmitry Shvedov
Dmitry Shvedov

Reputation: 3286

What you're talking about is write-resilience. This lib takes care of it: https://github.com/jevakallio/redux-offline

Upvotes: 0

J. Mark Stevens
J. Mark Stevens

Reputation: 4945

I would use atom/electron on the client along with reflux. When starting I would make an ajax call that would attempt authentication and if successful would trigger the updates. Otherwise it would just go along offline. An example using react with electron is at https://github.com/calitek/ReactPatterns React.14/ReFluxElectron.

Upvotes: 2

Related Questions