Hey folks,
I got a problem with PouchDB.
I have a local PouchDB and a remote CouchDB containing up to 4000 items. Connecting and fetching does work well, but on a mobile the inital sync does take a little bit longer and I want to start a bunch of functions after the initial sync, but for some reason the “complete” event is not beeing fired - only if I would set “live” to false within the options object.
Here is what I do:
this.products = new PouchDB('products');
let options = {
live: true,
retry: true,
continuous: true,
batch_size: 100, batches_limit: 30
};
this.products.sync("http://some-server:5984/some-db", options);
…and that’s what I would like to do, but the event “complete” is not getting fired for some reason
this.products = new PouchDB('products');
let options = {
live: true,
retry: true,
continuous: true,
batch_size: 100, batches_limit: 30
};
this.products.sync("http://some-server:5984/some-db", options).on('complete', function() {
this.getProductsDocuments().then(function() {
this.dotherStuffOnCompeletedProductsDocuments();
});
});
Does anyone have a glue what I have to do? I just followed the API, but no success at all
Thanks,
Oliver