we have a problem with promise
we have a problem with promise
Q: What is the difference between these four promises?
doSomething()
.then(function () {
return doSomethingElse();
});
doSomething()
.then(function () {
doSomethingElse();
});
doSomething()
.then(doSomethingElse());
doSomething()
.then(doSomethingElse);
PouchDB
https://github.com/pouchdb/pouchdb
var db = new PouchDB('dbname');
db.put({
_id: 'dave@gmail.com',
name: 'David',
age: 69
});
db.changes().on('change', function() {
console.log('Ch-Ch-Changes');
});
db.replicate.to('http://example.com/mydb');
CouchDB
Apache CouchDB™
https://github.com/apache/couchdb
无缝的多主机同步 从大数据扩展到移动, 使用直观的HTTP / JSON API 为可靠性而设计。
refs
https://pouchdb.com/2015/05/18/we-have-a-problem-with-promises.html
https://gist.github.com/nolanlawson/6ce81186421d2fa109a4
https://fex.baidu.com/blog/2015/07/we-have-a-problem-with-promises/
©xgqfrms 2012-2020
www.cnblogs.com 发布文章使用:只允许注册用户才可以访问!
本文首发于博客园,作者:xgqfrms,原文链接:https://www.cnblogs.com/xgqfrms/p/13984602.html
未经授权禁止转载,违者必究!