Classes

PouchLink

Link to be passed to a CozyClient instance to support CouchDB. It instantiates PouchDB collections for each doctype that it supports and knows how to respond to queries and mutations.

PouchManager

Handles the lifecycle of several pouches

  • Creates/Destroys the pouches
  • Replicates periodically

Link to be passed to a CozyClient instance to support CouchDB. It instantiates PouchDB collections for each doctype that it supports and knows how to respond to queries and mutations.

Kind: global class

pouchLink.handleOnSync()

Receives PouchDB updates (documents grouped by doctype). Normalizes the data (.id -> ._id, .rev -> _rev). Passes the data to the client and to the onSync handler.

Kind: instance method of PouchLink

pouchLink.startReplication() ⇒ void

User of the link can call this to start ongoing replications. Typically, it can be used when the application regains focus.

Kind: instance method of PouchLink
Access: public

pouchLink.stopReplication() ⇒ void

User of the link can call this to stop ongoing replications. Typically, it can be used when the applications loses focus.

Kind: instance method of PouchLink
Access: public

PouchManager

Handles the lifecycle of several pouches

Kind: global class

pouchManager.ensureDatabasesExist()

Via a call to info() we ensure the database exist on the remote side. This is done only once since after the first call, we are sure that the databases have been created.

Kind: instance method of PouchManager

pouchManager.startReplicationLoop()

Starts periodic syncing of the pouches

Kind: instance method of PouchManager

pouchManager.stopReplicationLoop()

Stop periodic syncing of the pouches

Kind: instance method of PouchManager

pouchManager.replicateOnce()

Starts replication

Kind: instance method of PouchManager