rxjs-rails 2.2.27 → 2.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +0 -3
- data/lib/rxjs/rails/version.rb +1 -1
- data/vendor/assets/javascripts/rx.aggregates.min.js +1 -1
- data/vendor/assets/javascripts/rx.all.compat.js +1545 -1441
- data/vendor/assets/javascripts/rx.all.compat.min.js +3 -3
- data/vendor/assets/javascripts/rx.all.js +1545 -1441
- data/vendor/assets/javascripts/rx.all.min.js +3 -3
- data/vendor/assets/javascripts/rx.async.compat.js +149 -152
- data/vendor/assets/javascripts/rx.async.compat.min.js +1 -1
- data/vendor/assets/javascripts/rx.async.js +140 -143
- data/vendor/assets/javascripts/rx.async.min.js +1 -1
- data/vendor/assets/javascripts/rx.backpressure.min.js +1 -1
- data/vendor/assets/javascripts/rx.binding.js +18 -18
- data/vendor/assets/javascripts/rx.binding.min.js +1 -1
- data/vendor/assets/javascripts/rx.coincidence.min.js +1 -1
- data/vendor/assets/javascripts/rx.compat.js +490 -339
- data/vendor/assets/javascripts/rx.compat.min.js +2 -2
- data/vendor/assets/javascripts/rx.core.compat.js +109 -141
- data/vendor/assets/javascripts/rx.core.compat.min.js +1 -1
- data/vendor/assets/javascripts/rx.core.js +109 -141
- data/vendor/assets/javascripts/rx.core.min.js +1 -1
- data/vendor/assets/javascripts/rx.experimental.js +129 -136
- data/vendor/assets/javascripts/rx.experimental.min.js +1 -1
- data/vendor/assets/javascripts/rx.joinpatterns.js +59 -59
- data/vendor/assets/javascripts/rx.joinpatterns.min.js +1 -1
- data/vendor/assets/javascripts/rx.js +490 -339
- data/vendor/assets/javascripts/rx.lite.compat.js +1099 -954
- data/vendor/assets/javascripts/rx.lite.compat.min.js +2 -2
- data/vendor/assets/javascripts/rx.lite.extras.min.js +1 -1
- data/vendor/assets/javascripts/rx.lite.js +1099 -954
- data/vendor/assets/javascripts/rx.lite.min.js +2 -2
- data/vendor/assets/javascripts/rx.min.js +2 -2
- data/vendor/assets/javascripts/rx.testing.min.js +1 -1
- data/vendor/assets/javascripts/rx.time.js +715 -747
- data/vendor/assets/javascripts/rx.time.min.js +1 -1
- data/vendor/assets/javascripts/rx.virtualtime.min.js +1 -1
- metadata +11 -10
@@ -33,164 +33,161 @@
|
|
33
33
|
}
|
34
34
|
}.call(this, function (root, exp, Rx, undefined) {
|
35
35
|
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
36
|
+
// Aliases
|
37
|
+
var Observable = Rx.Observable,
|
38
|
+
observableProto = Observable.prototype,
|
39
|
+
observableFromPromise = Observable.fromPromise,
|
40
|
+
observableThrow = Observable.throwException,
|
41
|
+
AnonymousObservable = Rx.AnonymousObservable,
|
42
|
+
AsyncSubject = Rx.AsyncSubject,
|
43
|
+
disposableCreate = Rx.Disposable.create,
|
44
|
+
CompositeDisposable= Rx.CompositeDisposable,
|
45
|
+
immediateScheduler = Rx.Scheduler.immediate,
|
46
|
+
timeoutScheduler = Rx.Scheduler.timeout,
|
47
|
+
isScheduler = Rx.helpers.isScheduler,
|
48
|
+
slice = Array.prototype.slice;
|
48
49
|
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
50
|
+
/**
|
51
|
+
* Invokes the specified function asynchronously on the specified scheduler, surfacing the result through an observable sequence.
|
52
|
+
*
|
53
|
+
* @example
|
54
|
+
* var res = Rx.Observable.start(function () { console.log('hello'); });
|
55
|
+
* var res = Rx.Observable.start(function () { console.log('hello'); }, Rx.Scheduler.timeout);
|
56
|
+
* var res = Rx.Observable.start(function () { this.log('hello'); }, Rx.Scheduler.timeout, console);
|
57
|
+
*
|
58
|
+
* @param {Function} func Function to run asynchronously.
|
59
|
+
* @param {Scheduler} [scheduler] Scheduler to run the function on. If not specified, defaults to Scheduler.timeout.
|
60
|
+
* @param [context] The context for the func parameter to be executed. If not specified, defaults to undefined.
|
61
|
+
* @returns {Observable} An observable sequence exposing the function's result value, or an exception.
|
62
|
+
*
|
63
|
+
* Remarks
|
64
|
+
* * The function is called immediately, not during the subscription of the resulting sequence.
|
65
|
+
* * Multiple subscriptions to the resulting sequence can observe the function's result.
|
66
|
+
*/
|
67
|
+
Observable.start = function (func, context, scheduler) {
|
68
|
+
return observableToAsync(func, context, scheduler)();
|
69
|
+
};
|
69
70
|
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
71
|
+
/**
|
72
|
+
* Converts the function into an asynchronous function. Each invocation of the resulting asynchronous function causes an invocation of the original synchronous function on the specified scheduler.
|
73
|
+
*
|
74
|
+
* @example
|
75
|
+
* var res = Rx.Observable.toAsync(function (x, y) { return x + y; })(4, 3);
|
76
|
+
* var res = Rx.Observable.toAsync(function (x, y) { return x + y; }, Rx.Scheduler.timeout)(4, 3);
|
77
|
+
* var res = Rx.Observable.toAsync(function (x) { this.log(x); }, Rx.Scheduler.timeout, console)('hello');
|
78
|
+
*
|
79
|
+
* @param {Function} function Function to convert to an asynchronous function.
|
80
|
+
* @param {Scheduler} [scheduler] Scheduler to run the function on. If not specified, defaults to Scheduler.timeout.
|
81
|
+
* @param {Mixed} [context] The context for the func parameter to be executed. If not specified, defaults to undefined.
|
82
|
+
* @returns {Function} Asynchronous function.
|
83
|
+
*/
|
84
|
+
var observableToAsync = Observable.toAsync = function (func, context, scheduler) {
|
85
|
+
isScheduler(scheduler) || (scheduler = timeoutScheduler);
|
86
|
+
return function () {
|
87
|
+
var args = arguments,
|
88
|
+
subject = new AsyncSubject();
|
88
89
|
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
};
|
90
|
+
scheduler.schedule(function () {
|
91
|
+
var result;
|
92
|
+
try {
|
93
|
+
result = func.apply(context, args);
|
94
|
+
} catch (e) {
|
95
|
+
subject.onError(e);
|
96
|
+
return;
|
97
|
+
}
|
98
|
+
subject.onNext(result);
|
99
|
+
subject.onCompleted();
|
100
|
+
});
|
101
|
+
return subject.asObservable();
|
102
102
|
};
|
103
|
+
};
|
103
104
|
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
return function () {
|
116
|
-
var args = slice.call(arguments, 0);
|
105
|
+
/**
|
106
|
+
* Converts a callback function to an observable sequence.
|
107
|
+
*
|
108
|
+
* @param {Function} function Function with a callback as the last parameter to convert to an Observable sequence.
|
109
|
+
* @param {Mixed} [context] The context for the func parameter to be executed. If not specified, defaults to undefined.
|
110
|
+
* @param {Function} [selector] A selector which takes the arguments from the callback to produce a single item to yield on next.
|
111
|
+
* @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.
|
112
|
+
*/
|
113
|
+
Observable.fromCallback = function (func, context, selector) {
|
114
|
+
return function () {
|
115
|
+
var args = slice.call(arguments, 0);
|
117
116
|
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
}
|
130
|
-
} else {
|
131
|
-
if (results.length === 1) {
|
132
|
-
results = results[0];
|
133
|
-
}
|
134
|
-
}
|
117
|
+
return new AnonymousObservable(function (observer) {
|
118
|
+
function handler(e) {
|
119
|
+
var results = e;
|
120
|
+
|
121
|
+
if (selector) {
|
122
|
+
try {
|
123
|
+
results = selector(arguments);
|
124
|
+
} catch (err) {
|
125
|
+
observer.onError(err);
|
126
|
+
return;
|
127
|
+
}
|
135
128
|
|
136
|
-
|
137
|
-
|
138
|
-
|
129
|
+
observer.onNext(results);
|
130
|
+
} else {
|
131
|
+
if (results.length <= 1) {
|
132
|
+
observer.onNext.apply(observer, results);
|
133
|
+
} else {
|
134
|
+
observer.onNext(results);
|
135
|
+
}
|
136
|
+
}
|
137
|
+
|
138
|
+
observer.onCompleted();
|
139
|
+
}
|
139
140
|
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
});
|
144
|
-
};
|
141
|
+
args.push(handler);
|
142
|
+
func.apply(context, args);
|
143
|
+
});
|
145
144
|
};
|
145
|
+
};
|
146
146
|
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
return function () {
|
158
|
-
var args = slice.call(arguments, 0);
|
147
|
+
/**
|
148
|
+
* Converts a Node.js callback style function to an observable sequence. This must be in function (err, ...) format.
|
149
|
+
* @param {Function} func The function to call
|
150
|
+
* @param {Mixed} [context] The context for the func parameter to be executed. If not specified, defaults to undefined.
|
151
|
+
* @param {Function} [selector] A selector which takes the arguments from the callback minus the error to produce a single item to yield on next.
|
152
|
+
* @returns {Function} An async function which when applied, returns an observable sequence with the callback arguments as an array.
|
153
|
+
*/
|
154
|
+
Observable.fromNodeCallback = function (func, context, selector) {
|
155
|
+
return function () {
|
156
|
+
var args = slice.call(arguments, 0);
|
159
157
|
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
return;
|
167
|
-
}
|
158
|
+
return new AnonymousObservable(function (observer) {
|
159
|
+
function handler(err) {
|
160
|
+
if (err) {
|
161
|
+
observer.onError(err);
|
162
|
+
return;
|
163
|
+
}
|
168
164
|
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
165
|
+
var results = slice.call(arguments, 1);
|
166
|
+
|
167
|
+
if (selector) {
|
168
|
+
try {
|
169
|
+
results = selector(results);
|
170
|
+
} catch (e) {
|
171
|
+
observer.onError(e);
|
172
|
+
return;
|
173
|
+
}
|
174
|
+
observer.onNext(results);
|
175
|
+
} else {
|
176
|
+
if (results.length <= 1) {
|
177
|
+
observer.onNext.apply(observer, results);
|
178
|
+
} else {
|
179
|
+
observer.onNext(results);
|
180
|
+
}
|
181
|
+
}
|
183
182
|
|
184
|
-
|
185
|
-
|
186
|
-
}
|
183
|
+
observer.onCompleted();
|
184
|
+
}
|
187
185
|
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
});
|
192
|
-
};
|
186
|
+
args.push(handler);
|
187
|
+
func.apply(context, args);
|
188
|
+
});
|
193
189
|
};
|
190
|
+
};
|
194
191
|
|
195
192
|
function createListener (element, name, handler) {
|
196
193
|
// Node.js specific
|
@@ -1 +1 @@
|
|
1
|
-
(function(
|
1
|
+
(function(a){var b={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},c=b[typeof window]&&window||this,d=b[typeof exports]&&exports&&!exports.nodeType&&exports,e=b[typeof module]&&module&&!module.nodeType&&module,f=(e&&e.exports===d&&d,b[typeof global]&&global);!f||f.global!==f&&f.window!==f||(c=f),"function"==typeof define&&define.amd?define(["rx.binding","exports"],function(b,d){return c.Rx=a(c,d,b),c.Rx}):"object"==typeof module&&module&&module.exports===d?module.exports=a(c,module.exports,require("./rx")):c.Rx=a(c,{},c.Rx)}).call(this,function(a,b,c){function d(a,b,c){if(a.addListener)return a.addListener(b,c),k(function(){a.removeListener(b,c)});if(a.addEventListener)return a.addEventListener(b,c,!1),k(function(){a.removeEventListener(b,c,!1)});throw new Error("No listener found")}function e(a,b,c){var f=new l;if("function"==typeof a.item&&"number"==typeof a.length)for(var g=0,h=a.length;h>g;g++)f.add(e(a.item(g),b,c));else a&&f.add(d(a,b,c));return f}var f=c.Observable,g=(f.prototype,f.fromPromise),h=f.throwException,i=c.AnonymousObservable,j=c.AsyncSubject,k=c.Disposable.create,l=c.CompositeDisposable,m=(c.Scheduler.immediate,c.Scheduler.timeout),n=c.helpers.isScheduler,o=Array.prototype.slice;f.start=function(a,b,c){return p(a,b,c)()};var p=f.toAsync=function(a,b,c){return n(c)||(c=m),function(){var d=arguments,e=new j;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()}};f.fromCallback=function(a,b,c){return function(){var d=o.call(arguments,0);return new i(function(e){function f(a){var b=a;if(c){try{b=c(arguments)}catch(d){return void e.onError(d)}e.onNext(b)}else b.length<=1?e.onNext.apply(e,b):e.onNext(b);e.onCompleted()}d.push(f),a.apply(b,d)})}},f.fromNodeCallback=function(a,b,c){return function(){var d=o.call(arguments,0);return new i(function(e){function f(a){if(a)return void e.onError(a);var b=o.call(arguments,1);if(c){try{b=c(b)}catch(d){return void e.onError(d)}e.onNext(b)}else b.length<=1?e.onNext.apply(e,b):e.onNext(b);e.onCompleted()}d.push(f),a.apply(b,d)})}};var q=a.angular&&angular.element?angular.element:a.jQuery?a.jQuery:a.Zepto?a.Zepto:null,r=!!a.Ember&&"function"==typeof a.Ember.addListener;f.fromEvent=function(a,b,c){if(r)return s(function(c){Ember.addListener(a,b,c)},function(c){Ember.removeListener(a,b,c)},c);if(q){var d=q(a);return s(function(a){d.on(b,a)},function(a){d.off(b,a)},c)}return new i(function(d){return e(a,b,function(a){var b=a;if(c)try{b=c(arguments)}catch(e){return void d.onError(e)}d.onNext(b)})}).publish().refCount()};var s=f.fromEventPattern=function(a,b,c){return new i(function(d){function e(a){var b=a;if(c)try{b=c(arguments)}catch(e){return void d.onError(e)}d.onNext(b)}var f=a(e);return k(function(){b&&b(e,f)})}).publish().refCount()};return f.startAsync=function(a){var b;try{b=a()}catch(c){return h(c)}return g(b)},c});
|
@@ -1 +1 @@
|
|
1
|
-
(function(
|
1
|
+
(function(a){var b={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},c=b[typeof window]&&window||this,d=b[typeof exports]&&exports&&!exports.nodeType&&exports,e=b[typeof module]&&module&&!module.nodeType&&module,f=(e&&e.exports===d&&d,b[typeof global]&&global);!f||f.global!==f&&f.window!==f||(c=f),"function"==typeof define&&define.amd?define(["rx","exports"],function(b,d){return c.Rx=a(c,d,b),c.Rx}):"object"==typeof module&&module&&module.exports===d?module.exports=a(c,module.exports,require("./rx")):c.Rx=a(c,{},c.Rx)}).call(this,function(a,b,c){function d(){if(this.isDisposed)throw new Error(q)}function e(a,b,c){return new h(function(d){function e(a,b){k[b]=a;var e;if(g[b]=!0,h||(h=g.every(p))){try{e=c.apply(null,k)}catch(f){return void d.onError(f)}d.onNext(e)}else j&&d.onCompleted()}var f=2,g=[!1,!1],h=!1,j=!1,k=new Array(f);return new i(a.subscribe(function(a){e(a,0)},d.onError.bind(d),function(){j=!0,d.onCompleted()}),b.subscribe(function(a){e(a,1)},d.onError.bind(d)))})}var f=c.Observable,g=f.prototype,h=c.AnonymousObservable,i=c.CompositeDisposable,j=c.Subject,k=c.Observer,l=c.Disposable.empty,m=c.Disposable.create,n=c.internals.inherits,o=c.internals.addProperties,p=(c.Scheduler.timeout,c.helpers.identity),q="Object has been disposed",r=function(a){function b(a){var b=this.source.publish(),c=b.subscribe(a),d=l,e=this.subject.distinctUntilChanged().subscribe(function(a){a?d=b.connect():(d.dispose(),d=l)});return new i(c,d,e)}function c(c,d){this.source=c,this.subject=d||new j,this.isPaused=!0,a.call(this,b)}return n(c,a),c.prototype.pause=function(){this.isPaused!==!0&&(this.isPaused=!0,this.subject.onNext(!1))},c.prototype.resume=function(){this.isPaused!==!1&&(this.isPaused=!1,this.subject.onNext(!0))},c}(f);g.pausable=function(a){return new r(this,a)};var s=function(a){function b(a){var b=[],c=!0,d=e(this.source,this.subject.distinctUntilChanged(),function(a,b){return{data:a,shouldFire:b}}).subscribe(function(d){if(d.shouldFire&&c&&a.onNext(d.data),d.shouldFire&&!c){for(;b.length>0;)a.onNext(b.shift());c=!0}else d.shouldFire||c?!d.shouldFire&&c&&(c=!1):b.push(d.data)},function(c){for(;b.length>0;)a.onNext(b.shift());a.onError(c)},function(){for(;b.length>0;)a.onNext(b.shift());a.onCompleted()});return this.subject.onNext(!1),d}function c(c,d){this.source=c,this.subject=d||new j,this.isPaused=!0,a.call(this,b)}return n(c,a),c.prototype.pause=function(){this.isPaused!==!0&&(this.isPaused=!0,this.subject.onNext(!1))},c.prototype.resume=function(){this.isPaused!==!1&&(this.isPaused=!1,this.subject.onNext(!0))},c}(f);g.pausableBuffered=function(a){return new s(this,a)},g.controlled=function(a){return null==a&&(a=!0),new t(this,a)};var t=function(a){function b(a){return this.source.subscribe(a)}function c(c,d){a.call(this,b),this.subject=new u(d),this.source=c.multicast(this.subject).refCount()}return n(c,a),c.prototype.request=function(a){return null==a&&(a=-1),this.subject.request(a)},c}(f),u=c.ControlledSubject=function(a){function b(a){return this.subject.subscribe(a)}function c(c){null==c&&(c=!0),a.call(this,b),this.subject=new j,this.enableQueue=c,this.queue=c?[]:null,this.requestedCount=0,this.requestedDisposable=l,this.error=null,this.hasFailed=!1,this.hasCompleted=!1,this.controlledDisposable=l}return n(c,a),o(c.prototype,k,{onCompleted:function(){d.call(this),this.hasCompleted=!0,this.enableQueue&&0!==this.queue.length||this.subject.onCompleted()},onError:function(a){d.call(this),this.hasFailed=!0,this.error=a,this.enableQueue&&0!==this.queue.length||this.subject.onError(a)},onNext:function(a){d.call(this);var b=!1;0===this.requestedCount?this.enableQueue&&this.queue.push(a):(-1!==this.requestedCount&&0===this.requestedCount--&&this.disposeCurrentRequest(),b=!0),b&&this.subject.onNext(a)},_processRequest:function(a){if(this.enableQueue){for(;this.queue.length>=a&&a>0;)this.subject.onNext(this.queue.shift()),a--;return 0!==this.queue.length?{numberOfItems:a,returnValue:!0}:{numberOfItems:a,returnValue:!1}}return this.hasFailed?(this.subject.onError(this.error),this.controlledDisposable.dispose(),this.controlledDisposable=l):this.hasCompleted&&(this.subject.onCompleted(),this.controlledDisposable.dispose(),this.controlledDisposable=l),{numberOfItems:a,returnValue:!1}},request:function(a){d.call(this),this.disposeCurrentRequest();var b=this,c=this._processRequest(a);return a=c.numberOfItems,c.returnValue?l:(this.requestedCount=a,this.requestedDisposable=m(function(){b.requestedCount=0}),this.requestedDisposable)},disposeCurrentRequest:function(){this.requestedDisposable.dispose(),this.requestedDisposable=l},dispose:function(){this.isDisposed=!0,this.error=null,this.subject.dispose(),this.requestedDisposable.dispose()}}),c}(f);return c});
|
@@ -192,24 +192,24 @@
|
|
192
192
|
}, selector);
|
193
193
|
};
|
194
194
|
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
195
|
+
/**
|
196
|
+
* Returns an observable sequence that shares a single subscription to the underlying sequence replaying notifications subject to a maximum time length for the replay buffer.
|
197
|
+
* This operator is a specialization of replay which creates a subscription when the number of observers goes from zero to one, then shares that subscription with all subsequent observers until the number of observers returns to zero, at which point the subscription is disposed.
|
198
|
+
*
|
199
|
+
* @example
|
200
|
+
* var res = source.shareReplay(3);
|
201
|
+
* var res = source.shareReplay(3, 500);
|
202
|
+
* var res = source.shareReplay(3, 500, scheduler);
|
203
|
+
*
|
204
|
+
|
205
|
+
* @param bufferSize [Optional] Maximum element count of the replay buffer.
|
206
|
+
* @param window [Optional] Maximum time length of the replay buffer.
|
207
|
+
* @param scheduler [Optional] Scheduler where connected observers within the selector function will be invoked on.
|
208
|
+
* @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence.
|
209
|
+
*/
|
210
|
+
observableProto.shareReplay = function (bufferSize, window, scheduler) {
|
211
|
+
return this.replay(null, bufferSize, window, scheduler).refCount();
|
212
|
+
};
|
213
213
|
|
214
214
|
/** @private */
|
215
215
|
var InnerSubscription = function (subject, observer) {
|
@@ -1 +1 @@
|
|
1
|
-
(function(
|
1
|
+
(function(a){var b={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},c=b[typeof window]&&window||this,d=b[typeof exports]&&exports&&!exports.nodeType&&exports,e=b[typeof module]&&module&&!module.nodeType&&module,f=(e&&e.exports===d&&d,b[typeof global]&&global);!f||f.global!==f&&f.window!==f||(c=f),"function"==typeof define&&define.amd?define(["rx","exports"],function(b,d){return c.Rx=a(c,d,b),c.Rx}):"object"==typeof module&&module&&module.exports===d?module.exports=a(c,module.exports,require("./rx")):c.Rx=a(c,{},c.Rx)}).call(this,function(a,b,c){function d(){if(this.isDisposed)throw new Error(r)}var e=c.Observable,f=e.prototype,g=c.AnonymousObservable,h=c.Subject,i=c.AsyncSubject,j=c.Observer,k=c.internals.ScheduledObserver,l=c.Disposable.create,m=c.Disposable.empty,n=c.CompositeDisposable,o=c.Scheduler.currentThread,p=c.internals.inherits,q=c.internals.addProperties,r="Object has been disposed";f.multicast=function(a,b){var c=this;return"function"==typeof a?new g(function(d){var e=c.multicast(a());return new n(b(e).subscribe(d),e.connect())}):new v(c,a)},f.publish=function(a){return a?this.multicast(function(){return new h},a):this.multicast(new h)},f.share=function(){return this.publish(null).refCount()},f.publishLast=function(a){return a?this.multicast(function(){return new i},a):this.multicast(new i)},f.publishValue=function(a,b){return 2===arguments.length?this.multicast(function(){return new t(b)},a):this.multicast(new t(a))},f.shareValue=function(a){return this.publishValue(a).refCount()},f.replay=function(a,b,c,d){return a?this.multicast(function(){return new u(b,c,d)},a):this.multicast(new u(b,c,d))},f.shareReplay=function(a,b,c){return this.replay(null,a,b,c).refCount()};var s=function(a,b){this.subject=a,this.observer=b};s.prototype.dispose=function(){if(!this.subject.isDisposed&&null!==this.observer){var a=this.subject.observers.indexOf(this.observer);this.subject.observers.splice(a,1),this.observer=null}};var t=c.BehaviorSubject=function(a){function b(a){if(d.call(this),!this.isStopped)return this.observers.push(a),a.onNext(this.value),new s(this,a);var b=this.exception;return b?a.onError(b):a.onCompleted(),m}function c(c){a.call(this,b),this.value=c,this.observers=[],this.isDisposed=!1,this.isStopped=!1,this.exception=null}return p(c,a),q(c.prototype,j,{hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(d.call(this),!this.isStopped){var a=this.observers.slice(0);this.isStopped=!0;for(var b=0,c=a.length;c>b;b++)a[b].onCompleted();this.observers=[]}},onError:function(a){if(d.call(this),!this.isStopped){var b=this.observers.slice(0);this.isStopped=!0,this.exception=a;for(var c=0,e=b.length;e>c;c++)b[c].onError(a);this.observers=[]}},onNext:function(a){if(d.call(this),!this.isStopped){this.value=a;for(var b=this.observers.slice(0),c=0,e=b.length;e>c;c++)b[c].onNext(a)}},dispose:function(){this.isDisposed=!0,this.observers=null,this.value=null,this.exception=null}}),c}(e),u=c.ReplaySubject=function(a){function b(a,b){this.subject=a,this.observer=b}function c(a){var c=new k(this.scheduler,a),e=new b(this,c);d.call(this),this._trim(this.scheduler.now()),this.observers.push(c);for(var f=this.q.length,g=0,h=this.q.length;h>g;g++)c.onNext(this.q[g].value);return this.hasError?(f++,c.onError(this.error)):this.isStopped&&(f++,c.onCompleted()),c.ensureActive(f),e}function e(b,d,e){this.bufferSize=null==b?Number.MAX_VALUE:b,this.windowSize=null==d?Number.MAX_VALUE:d,this.scheduler=e||o,this.q=[],this.observers=[],this.isStopped=!1,this.isDisposed=!1,this.hasError=!1,this.error=null,a.call(this,c)}return b.prototype.dispose=function(){if(this.observer.dispose(),!this.subject.isDisposed){var a=this.subject.observers.indexOf(this.observer);this.subject.observers.splice(a,1)}},p(e,a),q(e.prototype,j,{hasObservers:function(){return this.observers.length>0},_trim:function(a){for(;this.q.length>this.bufferSize;)this.q.shift();for(;this.q.length>0&&a-this.q[0].interval>this.windowSize;)this.q.shift()},onNext:function(a){var b;if(d.call(this),!this.isStopped){var c=this.scheduler.now();this.q.push({interval:c,value:a}),this._trim(c);for(var e=this.observers.slice(0),f=0,g=e.length;g>f;f++)b=e[f],b.onNext(a),b.ensureActive()}},onError:function(a){var b;if(d.call(this),!this.isStopped){this.isStopped=!0,this.error=a,this.hasError=!0;var c=this.scheduler.now();this._trim(c);for(var e=this.observers.slice(0),f=0,g=e.length;g>f;f++)b=e[f],b.onError(a),b.ensureActive();this.observers=[]}},onCompleted:function(){var a;if(d.call(this),!this.isStopped){this.isStopped=!0;var b=this.scheduler.now();this._trim(b);for(var c=this.observers.slice(0),e=0,f=c.length;f>e;e++)a=c[e],a.onCompleted(),a.ensureActive();this.observers=[]}},dispose:function(){this.isDisposed=!0,this.observers=null}}),e}(e),v=c.ConnectableObservable=function(a){function b(b,c){function d(a){return e.subject.subscribe(a)}var e={subject:c,source:b.asObservable(),hasSubscription:!1,subscription:null};this.connect=function(){return e.hasSubscription||(e.hasSubscription=!0,e.subscription=new n(e.source.subscribe(e.subject),l(function(){e.hasSubscription=!1}))),e.subscription},a.call(this,d)}return p(b,a),b.prototype.connect=function(){return this.connect()},b.prototype.refCount=function(){var a=null,b=0,c=this;return new g(function(d){var e,f;return b++,e=1===b,f=c.subscribe(d),e&&(a=c.connect()),l(function(){f.dispose(),b--,0===b&&a.dispose()})})},b}(e);return c});
|
@@ -1 +1 @@
|
|
1
|
-
(function(
|
1
|
+
(function(a){var b={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},c=b[typeof window]&&window||this,d=b[typeof exports]&&exports&&!exports.nodeType&&exports,e=b[typeof module]&&module&&!module.nodeType&&module,f=(e&&e.exports===d&&d,b[typeof global]&&global);!f||f.global!==f&&f.window!==f||(c=f),"function"==typeof define&&define.amd?define(["rx","exports"],function(b,d){return c.Rx=a(c,d,b),c.Rx}):"object"==typeof module&&module&&module.exports===d?module.exports=a(c,module.exports,require("./rx")):c.Rx=a(c,{},c.Rx)}).call(this,function(a,b,c,d){function e(a){if(a&!1)return 2===a;for(var b=Math.sqrt(a),c=3;b>=c;){if(a%c===0)return!1;c+=2}return!0}function f(a){var b,c,d;for(b=0;b<y.length;++b)if(c=y[b],c>=a)return c;for(d=1|a;d<y[y.length-1];){if(e(d))return d;d+=2}return a}function g(a){var b=757602046;if(!a.length)return b;for(var c=0,d=a.length;d>c;c++){var e=a.charCodeAt(c);b=(b<<5)-b+e,b&=b}return b}function h(a){var b=668265261;return a=61^a^a>>>16,a+=a<<3,a^=a>>>4,a*=b,a^=a>>>15}function i(){return{key:null,value:null,next:0,hashCode:0}}function j(a,b){return a.groupJoin(this,b,function(){return t()},function(a,b){return b})}function k(a){var b=this;return new u(function(c){var d=new r,e=new n,f=new o(e);return c.onNext(v(d,f)),e.add(b.subscribe(function(a){d.onNext(a)},function(a){d.onError(a),c.onError(a)},function(){d.onCompleted(),c.onCompleted()})),e.add(a.subscribe(function(){d.onCompleted(),d=new r,c.onNext(v(d,f))},function(a){d.onError(a),c.onError(a)},function(){d.onCompleted(),c.onCompleted()})),f})}function l(a){var b=this;return new u(function(c){var d,e=new q,f=new n(e),g=new o(f),h=new r;return c.onNext(v(h,g)),f.add(b.subscribe(function(a){h.onNext(a)},function(a){h.onError(a),c.onError(a)},function(){h.onCompleted(),c.onCompleted()})),d=function(){var b,f;try{f=a()}catch(i){return void c.onError(i)}b=new p,e.setDisposable(b),b.setDisposable(f.take(1).subscribe(x,function(a){h.onError(a),c.onError(a)},function(){h.onCompleted(),h=new r,c.onNext(v(h,g)),d()}))},d(),g})}var m=c.Observable,n=c.CompositeDisposable,o=c.RefCountDisposable,p=c.SingleAssignmentDisposable,q=c.SerialDisposable,r=c.Subject,s=m.prototype,t=m.empty,u=c.AnonymousObservable,v=(c.Observer.create,c.internals.addRef),w=c.internals.isEqual,x=c.helpers.noop,y=[1,3,7,13,31,61,127,251,509,1021,2039,4093,8191,16381,32749,65521,131071,262139,524287,1048573,2097143,4194301,8388593,16777213,33554393,67108859,134217689,268435399,536870909,1073741789,2147483647],z="no such key",A="duplicate key",B=function(){var a=0;return function(b){if(null==b)throw new Error(z);if("string"==typeof b)return g(b);if("number"==typeof b)return h(b);if("boolean"==typeof b)return b===!0?1:0;if(b instanceof Date)return b.getTime();if(b.getHashCode)return b.getHashCode();var c=17*a++;return b.getHashCode=function(){return c},c}}(),C=function(a,b){if(0>a)throw new Error("out of range");a>0&&this._initialize(a),this.comparer=b||w,this.freeCount=0,this.size=0,this.freeList=-1};return C.prototype._initialize=function(a){var b,c=f(a);for(this.buckets=new Array(c),this.entries=new Array(c),b=0;c>b;b++)this.buckets[b]=-1,this.entries[b]=i();this.freeList=-1},C.prototype.count=function(){return this.size},C.prototype.add=function(a,b){return this._insert(a,b,!0)},C.prototype._insert=function(a,b,c){this.buckets||this._initialize(0);for(var d,e=2147483647&B(a),f=e%this.buckets.length,g=this.buckets[f];g>=0;g=this.entries[g].next)if(this.entries[g].hashCode===e&&this.comparer(this.entries[g].key,a)){if(c)throw new Error(A);return void(this.entries[g].value=b)}this.freeCount>0?(d=this.freeList,this.freeList=this.entries[d].next,--this.freeCount):(this.size===this.entries.length&&(this._resize(),f=e%this.buckets.length),d=this.size,++this.size),this.entries[d].hashCode=e,this.entries[d].next=this.buckets[f],this.entries[d].key=a,this.entries[d].value=b,this.buckets[f]=d},C.prototype._resize=function(){var a=f(2*this.size),b=new Array(a);for(d=0;d<b.length;++d)b[d]=-1;var c=new Array(a);for(d=0;d<this.size;++d)c[d]=this.entries[d];for(var d=this.size;a>d;++d)c[d]=i();for(var e=0;e<this.size;++e){var g=c[e].hashCode%a;c[e].next=b[g],b[g]=e}this.buckets=b,this.entries=c},C.prototype.remove=function(a){if(this.buckets)for(var b=2147483647&B(a),c=b%this.buckets.length,d=-1,e=this.buckets[c];e>=0;e=this.entries[e].next){if(this.entries[e].hashCode===b&&this.comparer(this.entries[e].key,a))return 0>d?this.buckets[c]=this.entries[e].next:this.entries[d].next=this.entries[e].next,this.entries[e].hashCode=-1,this.entries[e].next=this.freeList,this.entries[e].key=null,this.entries[e].value=null,this.freeList=e,++this.freeCount,!0;d=e}return!1},C.prototype.clear=function(){var a,b;if(!(this.size<=0)){for(a=0,b=this.buckets.length;b>a;++a)this.buckets[a]=-1;for(a=0;a<this.size;++a)this.entries[a]=i();this.freeList=-1,this.size=0}},C.prototype._findEntry=function(a){if(this.buckets)for(var b=2147483647&B(a),c=this.buckets[b%this.buckets.length];c>=0;c=this.entries[c].next)if(this.entries[c].hashCode===b&&this.comparer(this.entries[c].key,a))return c;return-1},C.prototype.count=function(){return this.size-this.freeCount},C.prototype.tryGetValue=function(a){var b=this._findEntry(a);return b>=0?this.entries[b].value:d},C.prototype.getValues=function(){var a=0,b=[];if(this.entries)for(var c=0;c<this.size;c++)this.entries[c].hashCode>=0&&(b[a++]=this.entries[c].value);return b},C.prototype.get=function(a){var b=this._findEntry(a);if(b>=0)return this.entries[b].value;throw new Error(z)},C.prototype.set=function(a,b){this._insert(a,b,!1)},C.prototype.containskey=function(a){return this._findEntry(a)>=0},s.join=function(a,b,c,d){var e=this;return new u(function(f){var g=new n,h=!1,i=0,j=new C,k=!1,l=0,m=new C;return g.add(e.subscribe(function(a){var c,e,k,l,n=i++,o=new p;j.add(n,a),g.add(o),e=function(){return j.remove(n)&&0===j.count()&&h&&f.onCompleted(),g.remove(o)};try{c=b(a)}catch(q){return void f.onError(q)}o.setDisposable(c.take(1).subscribe(x,f.onError.bind(f),function(){e()})),l=m.getValues();for(var r=0;r<l.length;r++){try{k=d(a,l[r])}catch(s){return void f.onError(s)}f.onNext(k)}},f.onError.bind(f),function(){h=!0,(k||0===j.count())&&f.onCompleted()})),g.add(a.subscribe(function(a){var b,e,h,i,n=l++,o=new p;m.add(n,a),g.add(o),e=function(){return m.remove(n)&&0===m.count()&&k&&f.onCompleted(),g.remove(o)};try{b=c(a)}catch(q){return void f.onError(q)}o.setDisposable(b.take(1).subscribe(x,f.onError.bind(f),function(){e()})),i=j.getValues();for(var r=0;r<i.length;r++){try{h=d(i[r],a)}catch(q){return void f.onError(q)}f.onNext(h)}},f.onError.bind(f),function(){k=!0,(h||0===m.count())&&f.onCompleted()})),g})},s.groupJoin=function(a,b,c,d){var e=this;return new u(function(f){var g=function(){},h=new n,i=new o(h),j=new C,k=new C,l=0,m=0;return h.add(e.subscribe(function(a){var c=new r,e=l++;j.add(e,c);var m,n,o,q,s;try{s=d(a,v(c,i))}catch(t){for(o=j.getValues(),m=0,n=o.length;n>m;m++)o[m].onError(t);return void f.onError(t)}for(f.onNext(s),q=k.getValues(),m=0,n=q.length;n>m;m++)c.onNext(q[m]);var u=new p;h.add(u);var w,x=function(){j.remove(e)&&c.onCompleted(),h.remove(u)};try{w=b(a)}catch(t){for(o=j.getValues(),m=0,n=j.length;n>m;m++)o[m].onError(t);return void f.onError(t)}u.setDisposable(w.take(1).subscribe(g,function(a){for(o=j.getValues(),m=0,n=o.length;n>m;m++)o[m].onError(a);f.onError(a)},x))},function(a){for(var b=j.getValues(),c=0,d=b.length;d>c;c++)b[c].onError(a);f.onError(a)},f.onCompleted.bind(f))),h.add(a.subscribe(function(a){var b,d,e,i=m++;k.add(i,a);var l=new p;h.add(l);var n,o=function(){k.remove(i),h.remove(l)};try{n=c(a)}catch(q){for(b=j.getValues(),d=0,e=j.length;e>d;d++)b[d].onError(q);return void f.onError(q)}for(l.setDisposable(n.take(1).subscribe(g,function(a){for(b=j.getValues(),d=0,e=j.length;e>d;d++)b[d].onError(a);f.onError(a)},o)),b=j.getValues(),d=0,e=b.length;e>d;d++)b[d].onNext(a)},function(a){for(var b=j.getValues(),c=0,d=b.length;d>c;c++)b[c].onError(a);f.onError(a)})),i})},s.buffer=function(){return this.window.apply(this,arguments).selectMany(function(a){return a.toArray()})},s.window=function(a,b){return 1===arguments.length&&"function"!=typeof arguments[0]?k.call(this,a):"function"==typeof a?l.call(this,a):j.call(this,a,b)},s.pairwise=function(){var a=this;return new u(function(b){var c,d=!1;return a.subscribe(function(a){d?b.onNext([c,a]):d=!0,c=a},b.onError.bind(b),b.onCompleted.bind(b))})},s.partition=function(a,b){var c=this.publish().refCount();return[c.filter(a,b),c.filter(function(c,d,e){return!a.call(b,c,d,e)})]},c});
|