PouchDB keep polling while offline-open source projects pouchdb/pouchdb
NickColley
PouchDB’s goal is to mirror CouchDB with feature parity, one feature of CouchDB’s replication is that it will timeout after a while if it’s offline so this’ll require you to start replicating again as you’ve noted.
There is an open issue (https://github.com/pouchdb/pouchdb/issues/966) about infinite replication, so this would not be an issue but until then you can use the same replication call you used to start the replication in the first place:
db.replicate.to(remoteDB, [options]);
http://pouchdb.com/api.html#replication
One option would be to try something like http://github.hubspot.com/offline/docs/welcome/ but hopefully we can get this feature added to PouchDB.