-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathinvoke.min.js
More file actions
2 lines (1 loc) · 869 Bytes
/
Copy pathinvoke.min.js
File metadata and controls
2 lines (1 loc) · 869 Bytes
1
2
!function(a,b){typeof module!="undefined"?module.exports=b():typeof define=="function"&&define.amd?define(a,b):this[a]=b()}("invoke",function(){function a(a){this._curr=this._root=new b(a)}function b(a){this._next=null,this._fns=[a],this._err=null}return a.prototype={then:function(a){return this._curr=this._curr.child(a),this},and:function(a){return this._curr.sibling(a),this},rescue:function(a){return this._rescue=a,this},end:function(a,b){this._root.exec(a,this._rescue,b)}},b.prototype={child:function(a){return this._next=new b(a)},sibling:function(a){this._fns.push(a)},exec:function(a,b,c){function i(d,i){return function(){i(a,function(a,i){if(h._err)return;if(a)return h._err=a,b(a);e===1?f=i:f[d]=i,++g===e&&(h._next?h._next.exec(f,b,c):c(f))})}}var d,e=this._fns.length,f=[],g=0,h=this;for(d=0;d<e;d++)i(d,this._fns[d])()}},function(b){return new a(b)}})