syncStore
Synchroize your local storage 2 server.
features
- Concurrent Posting
- Concurrent Delay
- Customize number of entries at time
- Message Acknowledgment without losing
- All Messages with CUID sequential identities.
- ...
options
// How many entries in just one packge.entryMaxOfPkg: 5// Maximum ConcurrencyconcurrentMax: 1 // default 1, to make sure sequentially posting.// Concurrency DelayconcurrentInterval: 5000// Start Acknowlegement Mechanism (return array of `cuid` which without// beening handled properly by server,// they need to be repost again. default:false, status code 2XX will be// considered success.entryACK: false// local name of databasename: 'defaultDatabase'// local store namestoreName: 'defaultDataStore'// select localstorage for general purpose.driver:localforageLOCALSTORAGE
API
- config(options) config options refer to above.
- push(entry) commit data to local database
- sync() start to sync. call
config
at first to setendPoint
usage
localStore// push data into databaselocalStore// synclocalStore
that's all. any feedback will be appreciated.