xgqfrms™, xgqfrms® : xgqfrms's offical website of cnblogs! xgqfrms™, xgqfrms® : xgqfrms's offical website of GitHub!

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

https://pouchdb.com/


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://couchdb.apache.org/

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 发布文章使用:只允许注册用户才可以访问!


posted @ 2020-11-16 13:15  xgqfrms  阅读(91)  评论(0编辑  收藏  举报