UNPKG

will

Version:

Flexible futures

43 lines (34 loc) 785 B
// Generated by CoffeeScript 1.6.3 (function() { var Resolver; module.exports = Resolver = (function() { var allowed, name; allowed = { as: true, given: true, resolve: true, accept: true, reject: true }; function Resolver(deferral) { this._apply = function(method, args) { if (!allowed[method]) { return; } deferral[method].apply(deferral, args); return this; }; } Resolver.prototype.resolver = function() { return this; }; for (name in allowed) { Resolver.prototype[name] = (function(name) { return function() { return this._apply(name, arguments); }; })(name); } return Resolver; })(); }).call(this);