访问次数
我的另一个总结性博客: todototry 大米粒

javascript promises powered by BlueBird

 

什么是promises? 为什么需要promises? 

 

参见: https://promisesaplus.com/

 

使用示例:

使用promises之前,代码的编写方式:

 

 

使用promises之后:

 

 

 

参考:

1. https://github.com/petkaantonov/bluebird

2. http://spion.github.io/posts/why-i-am-switching-to-promises.html

3. 如何优雅地crash你的nodejs app:  http://nodejs.org/api/domain.html#domain_warning_don_t_ignore_errors

4. https://blog.domenic.me/youre-missing-the-point-of-promises/#toc_1

5. https://github.com/petkaantonov/bluebird/wiki/Snippets

6. https://github.com/petkaantonov/bluebird/wiki/Promise-anti-patterns

7. https://github.com/petkaantonov/bluebird/blob/master/API.md

8. https://github.com/petkaantonov/bluebird#features

9. https://github.com/petkaantonov/bluebird/blob/master/API.md#resource-management

10 .https://promisesaplus.com/

 

posted @ 2015-02-01 22:19  fandyst  阅读(298)  评论(0编辑  收藏  举报