摘要: backbone.js珍藏版,方便一次阅读! 阅读全文
posted @ 2014-09-14 22:12 breezefeng 阅读(3817) 评论(0) 推荐(1) 编辑
摘要: 直接贴代码: /** * 迷你版的deferred */ function Deferred(func) { if (this instanceof Deferred === false) { return new Deferred(func) } var tuple = []; var promise = { resolve: function () { var t; while (t = tuple.shift()) { t.apply(null, arguments); } }, then: function (n) { return tuple.push(n), this; } } 阅读全文
posted @ 2014-09-14 13:28 breezefeng 阅读(385) 评论(0) 推荐(0) 编辑