Repository navigation
Expand file tree
/
Copy pathrx.async.min.js
More file actions
1 lines (1 loc) · 2.5 KB
/
Copy pathrx.async.min.js
File metadata and controls
1 lines (1 loc) · 2.5 KB
1
(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,o=e[typeof module]&&module&&!module.nodeType&&module,i=(o&&o.exports===r&&r,e[typeof global]&&global);!i||i.global!==i&&i.window!==i||(n=i),"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){return t.addListener?(t.addListener(e,n),l(function(){t.removeListener(e,n)})):t.addEventListener?(t.addEventListener(e,n,!1),l(function(){t.removeEventListener(e,n,!1)})):undefined}function o(t,e,n){var i=new f;if(t&&t.length)for(var s=0,u=t.length;u>s;s++)i.add(o(t[s],e,n));else t&&i.add(r(t,e,n));return i}var i=n.Observable,s=(i.prototype,i.fromPromise),u=i.throwException,c=n.AnonymousObservable,a=n.AsyncSubject,l=n.Disposable.create,f=n.CompositeDisposable,h=n.Scheduler.immediate,p=Array.prototype.slice;i.start=function(t,e,n){return d(t,e,n)()};var d=i.toAsync=function(t,e,n){return e||(e=timeoutScheduler),function(){var r=arguments,o=new a;return e.schedule(function(){var e;try{e=t.apply(n,r)}catch(i){return o.onError(i),undefined}o.onNext(e),o.onCompleted()}),o.asObservable()}};return i.fromCallback=function(t,e,n,r){return e||(e=h),function(){var o=p.call(arguments,0);return new c(function(i){return e.schedule(function(){function e(t){var e=t;if(r)try{e=r(arguments)}catch(n){return i.onError(n),undefined}else 1===e.length&&(e=e[0]);i.onNext(e),i.onCompleted()}o.push(e),t.apply(n,o)})})}},i.fromNodeCallback=function(t,e,n,r){return e||(e=h),function(){var o=p.call(arguments,0);return new c(function(i){return e.schedule(function(){function e(t){if(t)return i.onError(t),undefined;var e=p.call(arguments,1);if(r)try{e=r(e)}catch(n){return i.onError(n),undefined}else 1===e.length&&(e=e[0]);i.onNext(e),i.onCompleted()}o.push(e),t.apply(n,o)})})}},i.fromEvent=function(t,e,n){return new c(function(r){return o(t,e,function(t){var e=t;if(n)try{e=n(arguments)}catch(o){return r.onError(o),undefined}r.onNext(e)})}).publish().refCount()},i.fromEventPattern=function(t,e,n){return new c(function(r){function o(t){var e=t;if(n)try{e=n(arguments)}catch(o){return r.onError(o),undefined}r.onNext(e)}var i=t(o);return l(function(){e&&e(o,i)})}).publish().refCount()},i.startAsync=function(t){var e;try{e=t()}catch(n){return u(n)}return s(e)},n});