box-chrome-sdk
Version:
A Chrome App SDK for the Box V2 API
1 lines • 2.96 kB
JavaScript
(function(t){var e={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},n=e[typeof window]&&window||this,r=e[typeof exports]&&exports&&!exports.nodeType&&exports,i=e[typeof module]&&module&&!module.nodeType&&module,o=(i&&i.exports===r&&r,e[typeof global]&&global);!o||o.global!==o&&o.window!==o||(n=o),"function"==typeof define&&define.amd?define(["rx.binding","exports"],function(e,r){return n.Rx=t(n,r,e),n.Rx}):"object"==typeof module&&module&&module.exports===r?module.exports=t(n,module.exports,require("./rx")):n.Rx=t(n,{},n.Rx)}).call(this,function(t,e,n){function r(t,e,n){if(t.addListener)return t.addListener(e,n),h(function(){t.removeListener(e,n)});if(t.addEventListener)return t.addEventListener(e,n,!1),h(function(){t.removeEventListener(e,n,!1)});throw Error("No listener found")}function i(t,e,n){var o=new l;if("function"==typeof t.item&&"number"==typeof t.length)for(var s=0,u=t.length;u>s;s++)o.add(i(t.item(s),e,n));else t&&o.add(r(t,e,n));return o}var o=n.Observable,s=(o.prototype,o.fromPromise),u=o.throwException,c=n.AnonymousObservable,a=n.AsyncSubject,h=n.Disposable.create,l=n.CompositeDisposable,f=n.Scheduler.immediate,p=n.Scheduler.timeout,d=Array.prototype.slice;o.start=function(t,e,n){return v(t,e,n)()};var v=o.toAsync=function(t,e,n){return e||(e=p),function(){var r=arguments,i=new a;return e.schedule(function(){var e;try{e=t.apply(n,r)}catch(o){return i.onError(o),undefined}i.onNext(e),i.onCompleted()}),i.asObservable()}};o.fromCallback=function(t,e,n,r){return e||(e=f),function(){var i=d.call(arguments,0);return new c(function(o){return e.schedule(function(){function e(t){var e=t;if(r)try{e=r(arguments)}catch(n){return o.onError(n),undefined}else 1===e.length&&(e=e[0]);o.onNext(e),o.onCompleted()}i.push(e),t.apply(n,i)})})}},o.fromNodeCallback=function(t,e,n,r){return e||(e=f),function(){var i=d.call(arguments,0);return new c(function(o){return e.schedule(function(){function e(t){if(t)return o.onError(t),undefined;var e=d.call(arguments,1);if(r)try{e=r(e)}catch(n){return o.onError(n),undefined}else 1===e.length&&(e=e[0]);o.onNext(e),o.onCompleted()}i.push(e),t.apply(n,i)})})}};var b=t.angular&&angular.element?angular.element:t.jQuery?t.jQuery:t.Zepto?t.Zepto:null,m=!!t.Ember&&"function"==typeof t.Ember.addListener;o.fromEvent=function(t,e,n){if(m)return y(function(n){Ember.addListener(t,e,n)},function(n){Ember.removeListener(t,e,n)},n);if(b){var r=b(t);return y(function(t){r.on(e,t)},function(t){r.off(e,t)},n)}return new c(function(r){return i(t,e,function(t){var e=t;if(n)try{e=n(arguments)}catch(i){return r.onError(i),undefined}r.onNext(e)})}).publish().refCount()};var y=o.fromEventPattern=function(t,e,n){return new c(function(r){function i(t){var e=t;if(n)try{e=n(arguments)}catch(i){return r.onError(i),undefined}r.onNext(e)}var o=t(i);return h(function(){e&&e(i,o)})}).publish().refCount()};return o.startAsync=function(t){var e;try{e=t()}catch(n){return u(n)}return s(e)},n});