Skip to content

Instantly share code, notes, and snippets.

@odoe odoe/sample.js

Created Dec 22, 2014
Embed
What would you like to do?
Sample of how to use PouchDBStore with FeatureLayer
selectedTemplate.featureLayer.applyEdits(newAdds, null, null)
.then(function() {
db.getAll().then(function(results) {
console.debug('results', results);
var graphics = results.map(function(r) { return new Graphic(r.doc.item); });
var docs = results.map(function(r) { return r.doc; });
selectedTemplate.featureLayer.applyEdits(graphics).then(function() {
docs.map(function(doc) {
db.delete(doc);
});
});
});
}, function() {
arrayUtils.forEach(newAdds, function(x) {
db.add(x);
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.