rxjs-rails 2.5.2 → 3.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rxjs/rails/version.rb +1 -1
- data/vendor/assets/javascripts/rx.aggregates.js +367 -284
- data/vendor/assets/javascripts/rx.aggregates.map +1 -1
- data/vendor/assets/javascripts/rx.aggregates.min.js +1 -1
- data/vendor/assets/javascripts/rx.all.compat.js +2405 -2438
- data/vendor/assets/javascripts/rx.all.compat.map +1 -1
- data/vendor/assets/javascripts/rx.all.compat.min.js +4 -4
- data/vendor/assets/javascripts/rx.all.js +2380 -2395
- data/vendor/assets/javascripts/rx.all.map +1 -1
- data/vendor/assets/javascripts/rx.all.min.js +4 -4
- data/vendor/assets/javascripts/rx.async.compat.js +311 -333
- data/vendor/assets/javascripts/rx.async.compat.map +1 -1
- data/vendor/assets/javascripts/rx.async.compat.min.js +1 -1
- data/vendor/assets/javascripts/rx.async.js +280 -327
- data/vendor/assets/javascripts/rx.async.map +1 -1
- data/vendor/assets/javascripts/rx.async.min.js +1 -1
- data/vendor/assets/javascripts/rx.backpressure.js +208 -176
- data/vendor/assets/javascripts/rx.backpressure.map +1 -1
- data/vendor/assets/javascripts/rx.backpressure.min.js +1 -1
- data/vendor/assets/javascripts/rx.binding.js +44 -27
- data/vendor/assets/javascripts/rx.binding.map +1 -1
- data/vendor/assets/javascripts/rx.binding.min.js +1 -1
- data/vendor/assets/javascripts/rx.coincidence.js +220 -453
- data/vendor/assets/javascripts/rx.coincidence.map +1 -1
- data/vendor/assets/javascripts/rx.coincidence.min.js +1 -1
- data/vendor/assets/javascripts/rx.compat.js +1366 -1173
- data/vendor/assets/javascripts/rx.compat.map +1 -1
- data/vendor/assets/javascripts/rx.compat.min.js +3 -2
- data/vendor/assets/javascripts/rx.core.binding.js +823 -0
- data/vendor/assets/javascripts/rx.core.binding.map +1 -0
- data/vendor/assets/javascripts/rx.core.binding.min.js +3 -0
- data/vendor/assets/javascripts/rx.core.js +1281 -0
- data/vendor/assets/javascripts/rx.core.map +1 -0
- data/vendor/assets/javascripts/rx.core.min.js +3 -0
- data/vendor/assets/javascripts/rx.core.testing.js +1242 -0
- data/vendor/assets/javascripts/rx.core.testing.map +1 -0
- data/vendor/assets/javascripts/rx.core.testing.min.js +3 -0
- data/vendor/assets/javascripts/rx.experimental.js +85 -123
- data/vendor/assets/javascripts/rx.experimental.map +1 -1
- data/vendor/assets/javascripts/rx.experimental.min.js +1 -1
- data/vendor/assets/javascripts/rx.joinpatterns.js +48 -37
- data/vendor/assets/javascripts/rx.joinpatterns.map +1 -1
- data/vendor/assets/javascripts/rx.joinpatterns.min.js +1 -1
- data/vendor/assets/javascripts/rx.js +1367 -1174
- data/vendor/assets/javascripts/rx.lite.compat.js +1621 -1403
- data/vendor/assets/javascripts/rx.lite.compat.map +1 -1
- data/vendor/assets/javascripts/rx.lite.compat.min.js +3 -3
- data/vendor/assets/javascripts/rx.lite.extras.compat.js +119 -89
- data/vendor/assets/javascripts/rx.lite.extras.compat.map +1 -1
- data/vendor/assets/javascripts/rx.lite.extras.compat.min.js +1 -1
- data/vendor/assets/javascripts/rx.lite.extras.js +119 -89
- data/vendor/assets/javascripts/rx.lite.extras.map +1 -1
- data/vendor/assets/javascripts/rx.lite.extras.min.js +1 -1
- data/vendor/assets/javascripts/rx.lite.js +1583 -1390
- data/vendor/assets/javascripts/rx.lite.map +1 -1
- data/vendor/assets/javascripts/rx.lite.min.js +3 -3
- data/vendor/assets/javascripts/rx.map +1 -1
- data/vendor/assets/javascripts/rx.min.js +3 -2
- data/vendor/assets/javascripts/rx.sorting.js +23 -27
- data/vendor/assets/javascripts/rx.sorting.map +1 -1
- data/vendor/assets/javascripts/rx.sorting.min.js +1 -1
- data/vendor/assets/javascripts/rx.testing.js +11 -15
- data/vendor/assets/javascripts/rx.testing.map +1 -1
- data/vendor/assets/javascripts/rx.testing.min.js +1 -1
- data/vendor/assets/javascripts/rx.time.js +117 -133
- data/vendor/assets/javascripts/rx.time.map +1 -1
- data/vendor/assets/javascripts/rx.time.min.js +1 -1
- data/vendor/assets/javascripts/rx.virtualtime.js +120 -39
- data/vendor/assets/javascripts/rx.virtualtime.map +1 -1
- data/vendor/assets/javascripts/rx.virtualtime.min.js +1 -1
- metadata +12 -3
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"rx.async.compat.min.js","sources":["rx.async.compat.js"],"names":["factory","objectTypes","boolean","function","object","number","string","undefined","root","window","this","freeExports","exports","nodeType","freeModule","module","freeGlobal","global","define","amd","Rx","require","call","exp","toThunk","obj","ctx","Array","isArray","objectToThunk","isGeneratorFunction","observableSpawn","isGenerator","isObservable","observableToThunk","isPromise","promiseToThunk","fnString","isObject","done","run","fn","key","finished","results","pending","err","res","e","keys","Object","length","constructor","timeoutScheduler","schedule","i","len","observable","value","hasValue","subscribe","v","promise","then","name","next","throwString","handleError","fixEvent","event","stopPropagation","cancelBubble","preventDefault","bubbledKeyCode","keyCode","ctrlKey","defaultPrevented","returnValue","modified","target","srcElement","type","relatedTarget","fromElement","toElement","c","charCode","keyChar","String","fromCharCode","createListener","element","handler","addEventListener","disposableCreate","removeEventListener","attachEvent","innerHandler","detachEvent","createEventListener","el","eventName","disposables","CompositeDisposable","prototype","toString","add","item","Observable","observableFromPromise","fromPromise","observableThrow","throwError","AnonymousObservable","AsyncSubject","Disposable","create","Scheduler","immediate","isScheduler","slice","internals","spawn","isGenFun","exit","bind","ret","arguments","push","gen","TypeError","called","apply","args","hasCallback","pop","start","func","context","scheduler","observableToAsync","toAsync","subject","result","onError","onNext","onCompleted","asObservable","fromCallback","selector","observer","publishLast","refCount","fromNodeCallback","config","useNativeEvents","fromEvent","addListener","fromEventPattern","h","removeListener","on","off","publish","addHandler","removeHandler","startAsync","functionAsync"],"mappings":";CAEE,SAAUA,GACR,GAAIC,IACAC,WAAW,EACXC,YAAY,EACZC,QAAU,EACVC,QAAU,EACVC,QAAU,EACVC,WAAa,GAGbC,EAAQP,QAAmBQ,UAAWA,QAAWC,KACjDC,EAAcV,QAAmBW,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GAAIjD,GAAoB,SAAUqC,GACvC,MAAOnD,GACLR,EACAU,EACA,SAAkBrD,GAChB,GAAIJ,GAAUI,CAEd,IAAIqG,EACF,IACEzG,EAAUyG,EAAStB,WACnB,MAAOjF,GACP,MAAOwG,GAASN,QAAQlG,GAI5BwG,EAASL,OAAOrG,OAEnBuH,UAAUX,WAvBFM,EACL,SAAUC,GAAKpE,EAAQsE,GAAG5D,EAAW0D,IACrC,SAAUA,GAAKpE,EAAQuE,IAAI7D,EAAW0D,IACtCV,GA8BR,IAAIS,GAAmBlD,EAAWkD,iBAAmB,SAAUM,EAAYC,EAAehB,GACxF,MAAO,IAAIpC,GAAoB,SAAUqC,GACvC,QAASrD,GAAcjD,GACrB,GAAI+F,GAAS/F,CACb,IAAIqG,EACF,IACEN,EAASM,EAAStB,WAClB,MAAOjF,GACP,MAAOwG,GAASN,QAAQlG,GAG5BwG,EAASL,OAAOF,GAGlB,GAAIlE,GAAcuF,EAAWnE,EAC7B,OAAOH,GAAiB,WAClBuE,GACFA,EAAcpE,EAAcpB,OAG/BsF,UAAUX,WAkBb,OAVF5C,GAAW0D,WAAa,SAAUC,GAChC,GAAIzG,EACJ,KACEA,EAAUyG,IACV,MAAOvH,GACP,MAAO+D,GAAgB/D,GAEzB,MAAO6D,GAAsB/C,IAGtB1C"}
|
1
|
+
{"version":3,"file":"rx.async.compat.min.js","sources":["rx.async.compat.js"],"names":["factory","objectTypes","function","object","freeExports","exports","nodeType","freeSelf","self","Object","freeWindow","window","freeModule","module","freeGlobal","global","root","this","define","amd","Rx","require","call","exp","undefined","tryCatcher","tryCatchTarget","apply","arguments","e","errorObj","tryCatch","fn","isFunction","TypeError","toObservable","obj","Observable","isObservable","isPromise","fromPromise","isGeneratorFunction","isGenerator","spawn","thunkToObservable","isArrayLike","isIterable","arrayToObservable","isObject","objectToObservable","from","flatMap","toArray","defer","observable","key","results","observables","push","map","next","constructor","keys","i","len","length","forkJoin","AnonymousObservable","o","err","res","onError","args","onNext","onCompleted","throw","ctor","name","displayName","prototype","createCbObservable","ctx","selector","AsyncSubject","createCbHandler","asObservable","Array","createNodeObservable","createNodeHandler","isNodeList","el","StaticNodeList","NodeList","toString","fixEvent","event","stopPropagation","cancelBubble","preventDefault","bubbledKeyCode","keyCode","ctrlKey","defaultPrevented","returnValue","modified","target","srcElement","type","relatedTarget","fromElement","toElement","c","charCode","keyChar","String","fromCharCode","ListenDisposable","n","_e","_n","_fn","addEventListener","isDisposed","AttachEventDisposable","attachEvent","LevelOneDisposable","createListener","eventName","handler","createEventListener","disposables","CompositeDisposable","add","item","observableFromPromise","observableThrow","throwError","disposableCreate","Disposable","create","immediateScheduler","Scheduler","immediate","timeoutScheduler","isScheduler","helpers","wrap","createObservable","__generatorFunction__","gen","processGenerator","ret","done","value","g","subscribe","start","func","context","scheduler","observableToAsync","toAsync","subject","schedule","result","fromCallback","fromNodeCallback","dispose","removeEventListener","detachEvent","config","useNativeEvents","fromEvent","element","addListener","fromEventPattern","h","removeListener","on","off","publish","refCount","addHandler","removeHandler","innerHandler","startAsync","functionAsync","promise"],"mappings":";CAEE,SAAUA,GACV,GAAIC,IACFC,YAAY,EACZC,QAAU,GAIVC,EAAcH,QAAmBI,WAAYA,UAAYA,QAAQC,UAAYD,QAC7EE,EAAWN,QAAmBO,QAASA,KAAKC,QAAUD,KACtDE,EAAaT,QAAmBU,UAAWA,QAAUA,OAAOF,QAAUE,OACtEC,EAAaX,QAAmBY,UAAWA,SAAWA,OAAOP,UAAYO,OAEzEC,GADgBF,GAAcA,EAAWP,UAAYD,GAAeA,EACvDA,GAAeQ,GAA+B,gBAAVG,SAAsBA,QAAUA,OAAON,QAAUM,QAEhGC,EAAOA,EAAOF,GAAgBJ,KAAgBO,MAAQA,KAAKN,SAAYD,GAAeH,GAAYU,IAGhF,mBAAXC,SAAyBA,OAAOC,IACzCD,QAAQ,eAAgB,WAAY,SAAUE,EAAIf,GAEhD,MADAW,GAAKI,GAAKpB,EAAQgB,EAAMX,EAASe,GAC1B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Z4H,UAAUC,WAlBFN,EACL,SAAUC,GAAKH,EAAQK,GAAGnD,EAAWiD,IACrC,SAAUA,GAAKH,EAAQM,IAAIpD,EAAWiD,IACtC9F,GA0BR,IAAI6F,GAAmB1I,EAAW0I,iBAAmB,SAAUO,EAAYC,EAAerG,EAAU6E,GAElG,MADAf,GAAYe,KAAeA,EAAYnB,GAChC,GAAIzE,GAAoB,SAAUC,GACvC,QAASoH,KACP,GAAIpB,GAASxI,UAAU,EACvB,OAAIK,GAAWiD,KACbkF,EAASrI,EAASmD,GAAUvD,MAAM,KAAMC,WACpCwI,IAAWtI,GAAmBsC,EAAEG,QAAQ6F,EAAOvI,OAErDuC,GAAEK,OAAO2F,GAGX,GAAI7D,GAAc+E,EAAWE,EAC7B,OAAO/C,GAAiB,WACtBxG,EAAWsJ,IAAkBA,EAAcC,EAAcjF,OAE1D6E,UAAUC,WAkBf,OAVAhJ,GAAWoJ,WAAa,SAAUC,GAChC,GAAIC,EACJ,KACEA,EAAUD,IACV,MAAO7J,GACP,MAAO0G,GAAgB1G,GAEzB,MAAOyG,GAAsBqD,IAGxBvK"}
|
@@ -1,3 +1,3 @@
|
|
1
1
|
/* Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.*/
|
2
|
-
(function(a){var b={"
|
2
|
+
(function(a){var b={"function":!0,object:!0},c=b[typeof exports]&&exports&&!exports.nodeType&&exports,d=b[typeof self]&&self.Object&&self,e=b[typeof window]&&window&&window.Object&&window,f=b[typeof module]&&module&&!module.nodeType&&module,g=(f&&f.exports===c&&c,c&&f&&"object"==typeof global&&global&&global.Object&&global),h=h=g||e!==(this&&this.window)&&e||d||this;"function"==typeof define&&define.amd?define(["./rx.binding","exports"],function(b,c){return h.Rx=a(h,c,b),h.Rx}):"object"==typeof module&&module&&module.exports===c?module.exports=a(h,module.exports,require("./rx")):h.Rx=a(h,{},h.Rx)}).call(this,function(a,b,c,d){function e(){try{return x.apply(this,arguments)}catch(a){return K.e=a,K}}function f(a){if(!J(a))throw new TypeError("fn must be a function");return x=a,e}function g(a){return a?y.isObservable(a)?a:I(a)?y.fromPromise(a):l(a)||k(a)?L.call(this,a):J(a)?j.call(this,a):isArrayLike(a)||isIterable(a)?h.call(this,a):isObject(a)?i.call(this,a):a:a}function h(a){return y.from(a).flatMap(g).toArray()}function i(a){function b(a,b){c[b]=d,f.push(a.map(function(a){c[b]=a}))}for(var c=new a.constructor,e=Object.keys(a),f=[],h=0,i=e.length;i>h;h++){var j=e[h],k=g.call(this,a[j]);k&&y.isObservable(k)?b(k,j):c[j]=a[j]}return y.forkJoin.apply(y,f).map(function(){return c})}function j(a){var b=this;return new B(function(c){a.call(b,function(){var a=arguments[0],b=arguments[1];if(a)return c.onError(a);if(arguments.length>2){for(var d=[],e=1,f=arguments.length;f>e;e++)d.push(arguments[e]);b=d}c.onNext(b),c.onCompleted()})})}function k(a){return J(a.next)&&J(a.throw)}function l(a){var b=a.constructor;return b?"GeneratorFunction"===b.name||"GeneratorFunction"===b.displayName?!0:k(b.prototype):!1}function m(a,b,c,d){var e=new C;return d.push(n(e,b,c)),a.apply(b,d),e.asObservable()}function n(a,b,c){return function(){for(var d=arguments.length,e=new Array(d),g=0;d>g;g++)e[g]=arguments[g];if(J(c)){if(e=f(c).apply(b,e),e===K)return a.onError(e.e);a.onNext(e)}else a.onNext(e.length<=1?e[0]:e);a.onCompleted()}}function o(a,b,c,d){var e=new C;return d.push(p(e,b,c)),a.apply(b,d),e.asObservable()}function p(a,b,c){return function(){var d=arguments[0];if(d)return a.onError(d);for(var e=arguments.length,g=[],h=1;e>h;h++)g[h-1]=arguments[h];if(J(c)){var g=f(c).apply(b,g);if(g===K)return a.onError(g.e);a.onNext(g)}else a.onNext(g.length<=1?g[0]:g);a.onCompleted()}}function q(a){return window.StaticNodeList?a instanceof window.StaticNodeList||a instanceof window.NodeList:"[object NodeList]"==Object.prototype.toString.call(a)}function r(b){var c=function(){this.cancelBubble=!0},d=function(){if(this.bubbledKeyCode=this.keyCode,this.ctrlKey)try{this.keyCode=0}catch(a){}this.defaultPrevented=!0,this.returnValue=!1,this.modified=!0};if(b||(b=a.event),!b.target)switch(b.target=b.target||b.srcElement,"mouseover"==b.type&&(b.relatedTarget=b.fromElement),"mouseout"==b.type&&(b.relatedTarget=b.toElement),b.stopPropagation||(b.stopPropagation=c,b.preventDefault=d),b.type){case"keypress":var e="charCode"in b?b.charCode:b.keyCode;10==e?(e=0,b.keyCode=13):13==e||27==e?e=0:3==e&&(e=99),b.charCode=e,b.keyChar=b.charCode?String.fromCharCode(b.charCode):""}return b}function s(a,b,c){this._e=a,this._n=b,this._fn=c,this._e.addEventListener(this._n,this._fn,!1),this.isDisposed=!1}function t(a,b,c){this._e=a,this._n="on"+b,this._fn=function(a){c(r(a))},this._e.attachEvent(this._n,this._fn),this.isDisposed=!1}function u(a,b,c){this._e=a,this._n="on"+b,this._e[this._n]=c,this.isDisposed=!1}function v(a,b,c){return a.addEventListener?new s(a,b,c):a.attachEvent?new t(a,b,c):u(a,b,c)}function w(a,b,c){var d=new E;if(q(a)||"[object HTMLCollection]"===Object.prototype.toString.call(a))for(var e=0,f=a.length;f>e;e++)d.add(w(a.item(e),b,c));else a&&d.add(v(a,b,c));return d}var x,y=c.Observable,z=(y.prototype,y.fromPromise),A=y.throwError,B=c.AnonymousObservable,C=c.AsyncSubject,D=c.Disposable.create,E=c.CompositeDisposable,F=c.Scheduler.immediate,G=c.Scheduler["default"],H=c.Scheduler.isScheduler,I=c.helpers.isPromise,J=c.helpers.isFunction,K={e:{}};y.wrap=function(a){function b(){return y.spawn.call(this,a.apply(this,arguments))}return b.__generatorFunction__=a,b};var L=y.spawn=function(){for(var a=arguments[0],b=this,c=[],d=1,e=arguments.length;e>d;d++)c.push(arguments[d]);return new B(function(d){function e(b){var c=f(a.next).call(a,b);return c===K?d.onError(c.e):void i(c)}function h(b){var c=f(a.next).call(a,b);return c===K?d.onError(c.e):void i(c)}function i(a){if(a.done)return d.onNext(a.value),void d.onCompleted();var c=g.call(b,a.value);y.isObservable(c)?j.add(c.subscribe(e,h)):h(new TypeError("type not supported"))}var j=new E;return J(a)&&(a=a.apply(b,c)),a&&J(a.next)?(e(),j):(d.onNext(a),d.onCompleted())})};y.start=function(a,b,c){return M(a,b,c)()};var M=y.toAsync=function(a,b,c){return H(c)||(c=G),function(){var d=arguments,e=new C;return c.schedule(function(){var c;try{c=a.apply(b,d)}catch(f){return void e.onError(f)}e.onNext(c),e.onCompleted()}),e.asObservable()}};y.fromCallback=function(a,b,c){return function(){"undefined"==typeof b&&(b=this);for(var d=arguments.length,e=new Array(d),f=0;d>f;f++)e[f]=arguments[f];return m(a,b,c,e)}},y.fromNodeCallback=function(a,b,c){return function(){"undefined"==typeof b&&(b=this);for(var d=arguments.length,e=new Array(d),f=0;d>f;f++)e[f]=arguments[f];return o(a,b,c,e)}},s.prototype.dispose=function(){this.isDisposed||(this._e.removeEventListener(this._n,this._fn,!1),this.isDisposed=!0)},t.prototype.dispose=function(){this.isDisposed||(this._e.detachEvent(this._n,this._fn),this.isDisposed=!0)},u.prototype.dispose=function(){this.isDisposed||(this._e[this._n]=null,this.isDisposed=!0)},c.config.useNativeEvents=!1,y.fromEvent=function(a,b,d){return a.addListener?N(function(c){a.addListener(b,c)},function(c){a.removeListener(b,c)},d):c.config.useNativeEvents||"function"!=typeof a.on||"function"!=typeof a.off?new B(function(c){return w(a,b,function(){var a=arguments[0];return J(d)&&(a=f(d).apply(null,arguments),a===K)?c.onError(a.e):void c.onNext(a)})}).publish().refCount():N(function(c){a.on(b,c)},function(c){a.off(b,c)},d)};var N=y.fromEventPattern=function(a,b,c,d){return H(d)||(d=F),new B(function(d){function e(){var a=arguments[0];return J(c)&&(a=f(c).apply(null,arguments),a===K)?d.onError(a.e):void d.onNext(a)}var g=a(e);return D(function(){J(b)&&b(e,g)})}).publish().refCount()};return y.startAsync=function(a){var b;try{b=a()}catch(c){return A(c)}return z(b)},c});
|
3
3
|
//# sourceMappingURL=rx.async.compat.map
|
@@ -1,36 +1,32 @@
|
|
1
1
|
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
|
2
2
|
|
3
3
|
;(function (factory) {
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
'number': false,
|
9
|
-
'string': false,
|
10
|
-
'undefined': false
|
11
|
-
};
|
12
|
-
|
13
|
-
var root = (objectTypes[typeof window] && window) || this,
|
14
|
-
freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports,
|
15
|
-
freeModule = objectTypes[typeof module] && module && !module.nodeType && module,
|
16
|
-
moduleExports = freeModule && freeModule.exports === freeExports && freeExports,
|
17
|
-
freeGlobal = objectTypes[typeof global] && global;
|
18
|
-
|
19
|
-
if (freeGlobal && (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal)) {
|
20
|
-
root = freeGlobal;
|
21
|
-
}
|
4
|
+
var objectTypes = {
|
5
|
+
'function': true,
|
6
|
+
'object': true
|
7
|
+
};
|
22
8
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
9
|
+
var
|
10
|
+
freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports,
|
11
|
+
freeSelf = objectTypes[typeof self] && self.Object && self,
|
12
|
+
freeWindow = objectTypes[typeof window] && window && window.Object && window,
|
13
|
+
freeModule = objectTypes[typeof module] && module && !module.nodeType && module,
|
14
|
+
moduleExports = freeModule && freeModule.exports === freeExports && freeExports,
|
15
|
+
freeGlobal = freeExports && freeModule && typeof global == 'object' && global && global.Object && global;
|
16
|
+
|
17
|
+
var root = root = freeGlobal || ((freeWindow !== (this && this.window)) && freeWindow) || freeSelf || this;
|
18
|
+
|
19
|
+
// Because of build optimizers
|
20
|
+
if (typeof define === 'function' && define.amd) {
|
21
|
+
define(['./rx.binding', 'exports'], function (Rx, exports) {
|
22
|
+
root.Rx = factory(root, exports, Rx);
|
23
|
+
return root.Rx;
|
24
|
+
});
|
25
|
+
} else if (typeof module === 'object' && module && module.exports === freeExports) {
|
26
|
+
module.exports = factory(root, module.exports, require('./rx'));
|
27
|
+
} else {
|
28
|
+
root.Rx = factory(root, {}, root.Rx);
|
29
|
+
}
|
34
30
|
}.call(this, function (root, exp, Rx, undefined) {
|
35
31
|
|
36
32
|
// Aliases
|
@@ -45,201 +41,152 @@
|
|
45
41
|
immediateScheduler = Rx.Scheduler.immediate,
|
46
42
|
timeoutScheduler = Rx.Scheduler['default'],
|
47
43
|
isScheduler = Rx.Scheduler.isScheduler,
|
48
|
-
|
49
|
-
|
50
|
-
var fnString = 'function',
|
51
|
-
throwString = 'throw',
|
52
|
-
isObject = Rx.internals.isObject;
|
53
|
-
|
54
|
-
function toThunk(obj, ctx) {
|
55
|
-
if (Array.isArray(obj)) { return objectToThunk.call(ctx, obj); }
|
56
|
-
if (isGeneratorFunction(obj)) { return observableSpawn(obj.call(ctx)); }
|
57
|
-
if (isGenerator(obj)) { return observableSpawn(obj); }
|
58
|
-
if (isObservable(obj)) { return observableToThunk(obj); }
|
59
|
-
if (isPromise(obj)) { return promiseToThunk(obj); }
|
60
|
-
if (typeof obj === fnString) { return obj; }
|
61
|
-
if (isObject(obj) || Array.isArray(obj)) { return objectToThunk.call(ctx, obj); }
|
62
|
-
|
63
|
-
return obj;
|
64
|
-
}
|
65
|
-
|
66
|
-
function objectToThunk(obj) {
|
67
|
-
var ctx = this;
|
68
|
-
|
69
|
-
return function (done) {
|
70
|
-
var keys = Object.keys(obj),
|
71
|
-
pending = keys.length,
|
72
|
-
results = new obj.constructor(),
|
73
|
-
finished;
|
74
|
-
|
75
|
-
if (!pending) {
|
76
|
-
timeoutScheduler.schedule(function () { done(null, results); });
|
77
|
-
return;
|
78
|
-
}
|
79
|
-
|
80
|
-
for (var i = 0, len = keys.length; i < len; i++) {
|
81
|
-
run(obj[keys[i]], keys[i]);
|
82
|
-
}
|
83
|
-
|
84
|
-
function run(fn, key) {
|
85
|
-
if (finished) { return; }
|
86
|
-
try {
|
87
|
-
fn = toThunk(fn, ctx);
|
88
|
-
|
89
|
-
if (typeof fn !== fnString) {
|
90
|
-
results[key] = fn;
|
91
|
-
return --pending || done(null, results);
|
92
|
-
}
|
93
|
-
|
94
|
-
fn.call(ctx, function(err, res) {
|
95
|
-
if (finished) { return; }
|
96
|
-
|
97
|
-
if (err) {
|
98
|
-
finished = true;
|
99
|
-
return done(err);
|
100
|
-
}
|
101
|
-
|
102
|
-
results[key] = res;
|
103
|
-
--pending || done(null, results);
|
104
|
-
});
|
105
|
-
} catch (e) {
|
106
|
-
finished = true;
|
107
|
-
done(e);
|
108
|
-
}
|
109
|
-
}
|
110
|
-
}
|
111
|
-
}
|
44
|
+
isPromise = Rx.helpers.isPromise,
|
45
|
+
isFunction = Rx.helpers.isFunction;
|
112
46
|
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
fn,
|
122
|
-
function () {
|
123
|
-
hasValue && fn(null, value);
|
124
|
-
});
|
47
|
+
var errorObj = {e: {}};
|
48
|
+
var tryCatchTarget;
|
49
|
+
function tryCatcher() {
|
50
|
+
try {
|
51
|
+
return tryCatchTarget.apply(this, arguments);
|
52
|
+
} catch (e) {
|
53
|
+
errorObj.e = e;
|
54
|
+
return errorObj;
|
125
55
|
}
|
126
56
|
}
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
fn(null, res);
|
132
|
-
}, fn);
|
133
|
-
}
|
57
|
+
function tryCatch(fn) {
|
58
|
+
if (!isFunction(fn)) { throw new TypeError('fn must be a function'); }
|
59
|
+
tryCatchTarget = fn;
|
60
|
+
return tryCatcher;
|
134
61
|
}
|
135
|
-
|
136
|
-
|
137
|
-
return obj && typeof obj.subscribe === fnString;
|
62
|
+
function thrower(e) {
|
63
|
+
throw e;
|
138
64
|
}
|
139
65
|
|
140
|
-
function
|
141
|
-
|
142
|
-
|
66
|
+
Observable.wrap = function (fn) {
|
67
|
+
createObservable.__generatorFunction__ = fn;
|
68
|
+
return createObservable;
|
143
69
|
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
/*
|
149
|
-
* Spawns a generator function which allows for Promises, Observable sequences, Arrays, Objects, Generators and functions.
|
150
|
-
* @param {Function} The spawning function.
|
151
|
-
* @returns {Function} a function which has a done continuation.
|
152
|
-
*/
|
153
|
-
var observableSpawn = Rx.spawn = function (fn) {
|
154
|
-
var isGenFun = isGeneratorFunction(fn);
|
70
|
+
function createObservable() {
|
71
|
+
return Observable.spawn.call(this, fn.apply(this, arguments));
|
72
|
+
}
|
73
|
+
};
|
155
74
|
|
156
|
-
|
157
|
-
|
158
|
-
|
75
|
+
var spawn = Observable.spawn = function () {
|
76
|
+
var gen = arguments[0], self = this, args = [];
|
77
|
+
for (var i = 1, len = arguments.length; i < len; i++) { args.push(arguments[i]); }
|
159
78
|
|
160
|
-
|
161
|
-
|
162
|
-
var len = args.length,
|
163
|
-
hasCallback = len && typeof args[len - 1] === fnString;
|
79
|
+
return new AnonymousObservable(function (o) {
|
80
|
+
var g = new CompositeDisposable();
|
164
81
|
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
82
|
+
if (isFunction(gen)) { gen = gen.apply(self, args); }
|
83
|
+
if (!gen || !isFunction(gen.next)) {
|
84
|
+
o.onNext(gen);
|
85
|
+
return o.onCompleted();
|
169
86
|
}
|
170
87
|
|
171
|
-
|
88
|
+
processGenerator();
|
172
89
|
|
173
|
-
function
|
174
|
-
|
90
|
+
function processGenerator(res) {
|
91
|
+
var ret = tryCatch(gen.next).call(gen, res);
|
92
|
+
if (ret === errorObj) { return o.onError(ret.e); }
|
93
|
+
next(ret);
|
175
94
|
}
|
176
95
|
|
177
|
-
function
|
178
|
-
var ret;
|
96
|
+
function onError(err) {
|
97
|
+
var ret = tryCatch(gen.next).call(gen, err);
|
98
|
+
if (ret === errorObj) { return o.onError(ret.e); }
|
99
|
+
next(ret);
|
100
|
+
}
|
179
101
|
|
180
|
-
|
181
|
-
if (
|
182
|
-
|
102
|
+
function next(ret) {
|
103
|
+
if (ret.done) {
|
104
|
+
o.onNext(ret.value);
|
105
|
+
o.onCompleted();
|
106
|
+
return;
|
183
107
|
}
|
184
|
-
|
185
|
-
if (
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
return exit(e);
|
190
|
-
}
|
108
|
+
var value = toObservable.call(self, ret.value);
|
109
|
+
if (Observable.isObservable(value)) {
|
110
|
+
g.add(value.subscribe(processGenerator, onError));
|
111
|
+
} else {
|
112
|
+
onError(new TypeError('type not supported'));
|
191
113
|
}
|
114
|
+
}
|
192
115
|
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
} catch (e) {
|
197
|
-
return exit(e);
|
198
|
-
}
|
199
|
-
}
|
116
|
+
return g;
|
117
|
+
});
|
118
|
+
}
|
200
119
|
|
201
|
-
|
202
|
-
|
203
|
-
|
120
|
+
function toObservable(obj) {
|
121
|
+
if (!obj) { return obj; }
|
122
|
+
if (Observable.isObservable(obj)) { return obj; }
|
123
|
+
if (isPromise(obj)) { return Observable.fromPromise(obj); }
|
124
|
+
if (isGeneratorFunction(obj) || isGenerator(obj)) { return spawn.call(this, obj); }
|
125
|
+
if (isFunction(obj)) { return thunkToObservable.call(this, obj); }
|
126
|
+
if (isArrayLike(obj) || isIterable(obj)) { return arrayToObservable.call(this, obj); }
|
127
|
+
if (isObject(obj)) {return objectToObservable.call(this, obj);}
|
128
|
+
return obj;
|
129
|
+
}
|
130
|
+
|
131
|
+
function arrayToObservable (obj) {
|
132
|
+
return Observable.from(obj)
|
133
|
+
.flatMap(toObservable)
|
134
|
+
.toArray();
|
135
|
+
}
|
136
|
+
|
137
|
+
function objectToObservable (obj) {
|
138
|
+
var results = new obj.constructor(), keys = Object.keys(obj), observables = [];
|
139
|
+
for (var i = 0, len = keys.length; i < len; i++) {
|
140
|
+
var key = keys[i];
|
141
|
+
var observable = toObservable.call(this, obj[key]);
|
142
|
+
|
143
|
+
if(observable && Observable.isObservable(observable)) {
|
144
|
+
defer(observable, key);
|
145
|
+
} else {
|
146
|
+
results[key] = obj[key];
|
147
|
+
}
|
148
|
+
}
|
204
149
|
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
var called = false;
|
209
|
-
try {
|
210
|
-
ret.value.call(ctx, function() {
|
211
|
-
if (called) {
|
212
|
-
return;
|
213
|
-
}
|
214
|
-
|
215
|
-
called = true;
|
216
|
-
next.apply(ctx, arguments);
|
217
|
-
});
|
218
|
-
} catch (e) {
|
219
|
-
timeoutScheduler.schedule(function () {
|
220
|
-
if (called) {
|
221
|
-
return;
|
222
|
-
}
|
223
|
-
|
224
|
-
called = true;
|
225
|
-
next.call(ctx, e);
|
226
|
-
});
|
227
|
-
}
|
228
|
-
return;
|
229
|
-
}
|
150
|
+
return Observable.forkJoin.apply(Observable, observables).map(function() {
|
151
|
+
return results;
|
152
|
+
});
|
230
153
|
|
231
|
-
// Not supported
|
232
|
-
next(new TypeError('Rx.spawn only supports a function, Promise, Observable, Object or Array.'));
|
233
|
-
}
|
234
|
-
}
|
235
|
-
};
|
236
154
|
|
237
|
-
function
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
});
|
155
|
+
function defer (observable, key) {
|
156
|
+
results[key] = undefined;
|
157
|
+
observables.push(observable.map(function (next) {
|
158
|
+
results[key] = next;
|
159
|
+
}));
|
242
160
|
}
|
161
|
+
}
|
162
|
+
|
163
|
+
function thunkToObservable(fn) {
|
164
|
+
var self = this;
|
165
|
+
return new AnonymousObservable(function (o) {
|
166
|
+
fn.call(self, function () {
|
167
|
+
var err = arguments[0], res = arguments[1];
|
168
|
+
if (err) { return o.onError(err); }
|
169
|
+
if (arguments.length > 2) {
|
170
|
+
var args = [];
|
171
|
+
for (var i = 1, len = arguments.length; i < len; i++) { args.push(arguments[i]); }
|
172
|
+
res = args;
|
173
|
+
}
|
174
|
+
o.onNext(res);
|
175
|
+
o.onCompleted();
|
176
|
+
});
|
177
|
+
});
|
178
|
+
}
|
179
|
+
|
180
|
+
function isGenerator(obj) {
|
181
|
+
return isFunction (obj.next) && isFunction (obj.throw);
|
182
|
+
}
|
183
|
+
|
184
|
+
function isGeneratorFunction(obj) {
|
185
|
+
var ctor = obj.constructor;
|
186
|
+
if (!ctor) { return false; }
|
187
|
+
if (ctor.name === 'GeneratorFunction' || ctor.displayName === 'GeneratorFunction') { return true; }
|
188
|
+
return isGenerator(ctor.prototype);
|
189
|
+
}
|
243
190
|
|
244
191
|
/**
|
245
192
|
* Invokes the specified function asynchronously on the specified scheduler, surfacing the result through an observable sequence.
|
@@ -290,115 +237,128 @@
|
|
290
237
|
};
|
291
238
|
};
|
292
239
|
|
293
|
-
|
294
|
-
|
295
|
-
*
|
296
|
-
* @param {Function} function Function with a callback as the last parameter to convert to an Observable sequence.
|
297
|
-
* @param {Mixed} [context] The context for the func parameter to be executed. If not specified, defaults to undefined.
|
298
|
-
* @param {Function} [selector] A selector which takes the arguments from the callback to produce a single item to yield on next.
|
299
|
-
* @returns {Function} A function, when executed with the required parameters minus the callback, produces an Observable sequence with a single value of the arguments to the callback as an array.
|
300
|
-
*/
|
301
|
-
Observable.fromCallback = function (func, context, selector) {
|
302
|
-
return function () {
|
303
|
-
var len = arguments.length, args = new Array(len)
|
304
|
-
for(var i = 0; i < len; i++) { args[i] = arguments[i]; }
|
305
|
-
|
306
|
-
return new AnonymousObservable(function (observer) {
|
307
|
-
function handler() {
|
308
|
-
var len = arguments.length, results = new Array(len);
|
309
|
-
for(var i = 0; i < len; i++) { results[i] = arguments[i]; }
|
310
|
-
|
311
|
-
if (selector) {
|
312
|
-
try {
|
313
|
-
results = selector.apply(context, results);
|
314
|
-
} catch (e) {
|
315
|
-
return observer.onError(e);
|
316
|
-
}
|
317
|
-
|
318
|
-
observer.onNext(results);
|
319
|
-
} else {
|
320
|
-
if (results.length <= 1) {
|
321
|
-
observer.onNext.apply(observer, results);
|
322
|
-
} else {
|
323
|
-
observer.onNext(results);
|
324
|
-
}
|
325
|
-
}
|
326
|
-
|
327
|
-
observer.onCompleted();
|
328
|
-
}
|
240
|
+
function createCbObservable(fn, ctx, selector, args) {
|
241
|
+
var o = new AsyncSubject();
|
329
242
|
|
330
|
-
|
331
|
-
|
332
|
-
}).publishLast().refCount();
|
333
|
-
};
|
334
|
-
};
|
243
|
+
args.push(createCbHandler(o, ctx, selector));
|
244
|
+
fn.apply(ctx, args);
|
335
245
|
|
336
|
-
|
337
|
-
|
338
|
-
* @param {Function} func The function to call
|
339
|
-
* @param {Mixed} [context] The context for the func parameter to be executed. If not specified, defaults to undefined.
|
340
|
-
* @param {Function} [selector] A selector which takes the arguments from the callback minus the error to produce a single item to yield on next.
|
341
|
-
* @returns {Function} An async function which when applied, returns an observable sequence with the callback arguments as an array.
|
342
|
-
*/
|
343
|
-
Observable.fromNodeCallback = function (func, context, selector) {
|
344
|
-
return function () {
|
345
|
-
var len = arguments.length, args = new Array(len);
|
346
|
-
for(var i = 0; i < len; i++) { args[i] = arguments[i]; }
|
347
|
-
|
348
|
-
return new AnonymousObservable(function (observer) {
|
349
|
-
function handler(err) {
|
350
|
-
if (err) {
|
351
|
-
observer.onError(err);
|
352
|
-
return;
|
353
|
-
}
|
354
|
-
|
355
|
-
var len = arguments.length, results = [];
|
356
|
-
for(var i = 1; i < len; i++) { results[i - 1] = arguments[i]; }
|
357
|
-
|
358
|
-
if (selector) {
|
359
|
-
try {
|
360
|
-
results = selector.apply(context, results);
|
361
|
-
} catch (e) {
|
362
|
-
return observer.onError(e);
|
363
|
-
}
|
364
|
-
observer.onNext(results);
|
365
|
-
} else {
|
366
|
-
if (results.length <= 1) {
|
367
|
-
observer.onNext.apply(observer, results);
|
368
|
-
} else {
|
369
|
-
observer.onNext(results);
|
370
|
-
}
|
371
|
-
}
|
372
|
-
|
373
|
-
observer.onCompleted();
|
374
|
-
}
|
246
|
+
return o.asObservable();
|
247
|
+
}
|
375
248
|
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
}
|
249
|
+
function createCbHandler(o, ctx, selector) {
|
250
|
+
return function handler () {
|
251
|
+
var len = arguments.length, results = new Array(len);
|
252
|
+
for(var i = 0; i < len; i++) { results[i] = arguments[i]; }
|
253
|
+
|
254
|
+
if (isFunction(selector)) {
|
255
|
+
results = tryCatch(selector).apply(ctx, results);
|
256
|
+
if (results === errorObj) { return o.onError(results.e); }
|
257
|
+
o.onNext(results);
|
258
|
+
} else {
|
259
|
+
if (results.length <= 1) {
|
260
|
+
o.onNext(results[0]);
|
261
|
+
} else {
|
262
|
+
o.onNext(results);
|
263
|
+
}
|
264
|
+
}
|
265
|
+
|
266
|
+
o.onCompleted();
|
267
|
+
};
|
268
|
+
}
|
269
|
+
|
270
|
+
/**
|
271
|
+
* Converts a callback function to an observable sequence.
|
272
|
+
*
|
273
|
+
* @param {Function} fn Function with a callback as the last parameter to convert to an Observable sequence.
|
274
|
+
* @param {Mixed} [ctx] The context for the func parameter to be executed. If not specified, defaults to undefined.
|
275
|
+
* @param {Function} [selector] A selector which takes the arguments from the callback to produce a single item to yield on next.
|
276
|
+
* @returns {Function} A function, when executed with the required parameters minus the callback, produces an Observable sequence with a single value of the arguments to the callback as an array.
|
277
|
+
*/
|
278
|
+
Observable.fromCallback = function (fn, ctx, selector) {
|
279
|
+
return function () {
|
280
|
+
typeof ctx === 'undefined' && (ctx = this);
|
281
|
+
|
282
|
+
var len = arguments.length, args = new Array(len)
|
283
|
+
for(var i = 0; i < len; i++) { args[i] = arguments[i]; }
|
284
|
+
return createCbObservable(fn, ctx, selector, args);
|
380
285
|
};
|
286
|
+
};
|
381
287
|
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
288
|
+
function createNodeObservable(fn, ctx, selector, args) {
|
289
|
+
var o = new AsyncSubject();
|
290
|
+
|
291
|
+
args.push(createNodeHandler(o, ctx, selector));
|
292
|
+
fn.apply(ctx, args);
|
293
|
+
|
294
|
+
return o.asObservable();
|
295
|
+
}
|
296
|
+
|
297
|
+
function createNodeHandler(o, ctx, selector) {
|
298
|
+
return function handler () {
|
299
|
+
var err = arguments[0];
|
300
|
+
if (err) { return o.onError(err); }
|
301
|
+
|
302
|
+
var len = arguments.length, results = [];
|
303
|
+
for(var i = 1; i < len; i++) { results[i - 1] = arguments[i]; }
|
304
|
+
|
305
|
+
if (isFunction(selector)) {
|
306
|
+
var results = tryCatch(selector).apply(ctx, results);
|
307
|
+
if (results === errorObj) { return o.onError(results.e); }
|
308
|
+
o.onNext(results);
|
309
|
+
} else {
|
310
|
+
if (results.length <= 1) {
|
311
|
+
o.onNext(results[0]);
|
312
|
+
} else {
|
313
|
+
o.onNext(results);
|
314
|
+
}
|
388
315
|
}
|
389
|
-
|
316
|
+
|
317
|
+
o.onCompleted();
|
318
|
+
};
|
319
|
+
}
|
320
|
+
|
321
|
+
/**
|
322
|
+
* Converts a Node.js callback style function to an observable sequence. This must be in function (err, ...) format.
|
323
|
+
* @param {Function} fn The function to call
|
324
|
+
* @param {Mixed} [ctx] The context for the func parameter to be executed. If not specified, defaults to undefined.
|
325
|
+
* @param {Function} [selector] A selector which takes the arguments from the callback minus the error to produce a single item to yield on next.
|
326
|
+
* @returns {Function} An async function which when applied, returns an observable sequence with the callback arguments as an array.
|
327
|
+
*/
|
328
|
+
Observable.fromNodeCallback = function (fn, ctx, selector) {
|
329
|
+
return function () {
|
330
|
+
typeof ctx === 'undefined' && (ctx = this);
|
331
|
+
var len = arguments.length, args = new Array(len);
|
332
|
+
for(var i = 0; i < len; i++) { args[i] = arguments[i]; }
|
333
|
+
return createNodeObservable(fn, ctx, selector, args);
|
334
|
+
};
|
335
|
+
};
|
336
|
+
|
337
|
+
function ListenDisposable(e, n, fn) {
|
338
|
+
this._e = e;
|
339
|
+
this._n = n;
|
340
|
+
this._fn = fn;
|
341
|
+
this._e.addEventListener(this._n, this._fn, false);
|
342
|
+
this.isDisposed = false;
|
390
343
|
}
|
344
|
+
ListenDisposable.prototype.dispose = function () {
|
345
|
+
if (!this.isDisposed) {
|
346
|
+
this._e.removeEventListener(this._n, this._fn, false);
|
347
|
+
this.isDisposed = true;
|
348
|
+
}
|
349
|
+
};
|
391
350
|
|
392
351
|
function createEventListener (el, eventName, handler) {
|
393
352
|
var disposables = new CompositeDisposable();
|
394
353
|
|
395
|
-
// Asume NodeList
|
396
|
-
|
354
|
+
// Asume NodeList or HTMLCollection
|
355
|
+
var elemToString = Object.prototype.toString.call(el);
|
356
|
+
if (elemToString === '[object NodeList]' || elemToString === '[object HTMLCollection]') {
|
397
357
|
for (var i = 0, len = el.length; i < len; i++) {
|
398
358
|
disposables.add(createEventListener(el.item(i), eventName, handler));
|
399
359
|
}
|
400
360
|
} else if (el) {
|
401
|
-
disposables.add(
|
361
|
+
disposables.add(new ListenDisposable(el, eventName, handler));
|
402
362
|
}
|
403
363
|
|
404
364
|
return disposables;
|
@@ -409,12 +369,19 @@
|
|
409
369
|
*/
|
410
370
|
Rx.config.useNativeEvents = false;
|
411
371
|
|
372
|
+
function eventHandler(o, selector) {
|
373
|
+
return function handler () {
|
374
|
+
var results = arguments[0];
|
375
|
+
if (isFunction(selector)) {
|
376
|
+
results = tryCatch(selector).apply(null, arguments);
|
377
|
+
if (results === errorObj) { return o.onError(results.e); }
|
378
|
+
}
|
379
|
+
o.onNext(results);
|
380
|
+
};
|
381
|
+
}
|
382
|
+
|
412
383
|
/**
|
413
384
|
* Creates an observable sequence by adding an event listener to the matching DOMElement or each item in the NodeList.
|
414
|
-
*
|
415
|
-
* @example
|
416
|
-
* var source = Rx.Observable.fromEvent(element, 'mouseup');
|
417
|
-
*
|
418
385
|
* @param {Object} element The DOMElement or NodeList to attach a listener.
|
419
386
|
* @param {String} eventName The event name to attach the observable sequence.
|
420
387
|
* @param {Function} [selector] A selector which takes the arguments from the event handler to produce a single item to yield on next.
|
@@ -439,23 +406,12 @@
|
|
439
406
|
selector);
|
440
407
|
}
|
441
408
|
}
|
442
|
-
|
409
|
+
|
410
|
+
return new AnonymousObservable(function (o) {
|
443
411
|
return createEventListener(
|
444
412
|
element,
|
445
413
|
eventName,
|
446
|
-
|
447
|
-
var results = e;
|
448
|
-
|
449
|
-
if (selector) {
|
450
|
-
try {
|
451
|
-
results = selector(arguments);
|
452
|
-
} catch (err) {
|
453
|
-
return observer.onError(err);
|
454
|
-
}
|
455
|
-
}
|
456
|
-
|
457
|
-
observer.onNext(results);
|
458
|
-
});
|
414
|
+
eventHandler(o, selector));
|
459
415
|
}).publish().refCount();
|
460
416
|
};
|
461
417
|
|
@@ -464,27 +420,24 @@
|
|
464
420
|
* @param {Function} addHandler The function to add a handler to the emitter.
|
465
421
|
* @param {Function} [removeHandler] The optional function to remove a handler from an emitter.
|
466
422
|
* @param {Function} [selector] A selector which takes the arguments from the event handler to produce a single item to yield on next.
|
423
|
+
* @param {Scheduler} [scheduler] A scheduler used to schedule the remove handler.
|
467
424
|
* @returns {Observable} An observable sequence which wraps an event from an event emitter
|
468
425
|
*/
|
469
|
-
var fromEventPattern = Observable.fromEventPattern = function (addHandler, removeHandler, selector) {
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
return observer.onError(err);
|
478
|
-
}
|
426
|
+
var fromEventPattern = Observable.fromEventPattern = function (addHandler, removeHandler, selector, scheduler) {
|
427
|
+
isScheduler(scheduler) || (scheduler = immediateScheduler);
|
428
|
+
return new AnonymousObservable(function (o) {
|
429
|
+
function innerHandler () {
|
430
|
+
var result = arguments[0];
|
431
|
+
if (isFunction(selector)) {
|
432
|
+
result = tryCatch(selector).apply(null, arguments);
|
433
|
+
if (result === errorObj) { return o.onError(result.e); }
|
479
434
|
}
|
480
|
-
|
435
|
+
o.onNext(result);
|
481
436
|
}
|
482
437
|
|
483
438
|
var returnValue = addHandler(innerHandler);
|
484
439
|
return disposableCreate(function () {
|
485
|
-
|
486
|
-
removeHandler(innerHandler, returnValue);
|
487
|
-
}
|
440
|
+
isFunction(removeHandler) && removeHandler(innerHandler, returnValue);
|
488
441
|
});
|
489
442
|
}).publish().refCount();
|
490
443
|
};
|
@@ -504,5 +457,5 @@
|
|
504
457
|
return observableFromPromise(promise);
|
505
458
|
}
|
506
459
|
|
507
|
-
|
460
|
+
return Rx;
|
508
461
|
}));
|