promise/deferred 是一个很好的处理异步调用编码的规范,下面以nodejs代码为类,来实现一个promise/A 规范的简单实现
代码如下:
/**
* Created with JetBrains WebStorm.
* User: xuwenmin
* Date: 14-4-1
* Time: 上午9:54
* To change this template use File | Settings | File Templates.
*/
var EventEmitter = require(‘events’).EventEmitter;
var http =
2021-03-01 20:04:26
31KB
AS
asc
c
1