Skip to content

Dexie.Syncable.IPersistedContext

David Fahlander edited this page May 18, 2014 · 9 revisions

Interface

interface IPersistedContext {
 save ();
};

Description

Context that the ISyncProtocol implementor may use to store persistant state info within.

ISyncProtocol may store any custom properties on the persistedContext and call save() to persist them.

Typically, this context could be used to save an identifyer for this particular local node agains the remote node. The remote node may then mark the changes applied by this node so that those changes are ignored when sending back its changes to you. In case the local database is deleted,

The context is saved in a special internal table within the same local database as you are syncing. If the database is deleted, so will you context be.

Methods

save()

Persist your context object to local database. When done, the returned promise will resolve. You may only store primitive types, objects and arrays in this context. You may not store functions or DomNodes.

Return Value

Promise

Clone this wiki locally