rxjs-rails 2.3.10 → 2.3.11
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 +120 -70
- data/vendor/assets/javascripts/rx.aggregates.min.js +3 -1
- data/vendor/assets/javascripts/rx.all.compat.js +1810 -1849
- data/vendor/assets/javascripts/rx.all.compat.min.js +5 -3
- data/vendor/assets/javascripts/rx.all.js +1776 -1815
- data/vendor/assets/javascripts/rx.all.min.js +5 -3
- data/vendor/assets/javascripts/rx.async.compat.js +45 -45
- data/vendor/assets/javascripts/rx.async.compat.min.js +3 -1
- data/vendor/assets/javascripts/rx.async.js +39 -39
- data/vendor/assets/javascripts/rx.async.min.js +3 -1
- data/vendor/assets/javascripts/rx.backpressure.js +21 -19
- data/vendor/assets/javascripts/rx.backpressure.min.js +3 -1
- data/vendor/assets/javascripts/rx.binding.js +90 -90
- data/vendor/assets/javascripts/rx.binding.min.js +3 -1
- data/vendor/assets/javascripts/rx.coincidence.js +184 -179
- data/vendor/assets/javascripts/rx.coincidence.min.js +3 -1
- data/vendor/assets/javascripts/rx.compat.js +1019 -1001
- data/vendor/assets/javascripts/rx.compat.min.js +4 -2
- data/vendor/assets/javascripts/rx.experimental.js +65 -64
- data/vendor/assets/javascripts/rx.experimental.min.js +3 -1
- data/vendor/assets/javascripts/rx.joinpatterns.js +265 -363
- data/vendor/assets/javascripts/rx.joinpatterns.min.js +3 -1
- data/vendor/assets/javascripts/rx.js +969 -951
- data/vendor/assets/javascripts/rx.lite.compat.js +1014 -1182
- data/vendor/assets/javascripts/rx.lite.compat.min.js +4 -2
- data/vendor/assets/javascripts/rx.lite.extras.js +101 -109
- data/vendor/assets/javascripts/rx.lite.extras.min.js +3 -1
- data/vendor/assets/javascripts/rx.lite.js +1008 -1176
- data/vendor/assets/javascripts/rx.lite.min.js +4 -2
- data/vendor/assets/javascripts/rx.min.js +4 -2
- data/vendor/assets/javascripts/rx.testing.js +196 -196
- data/vendor/assets/javascripts/rx.testing.min.js +3 -1
- data/vendor/assets/javascripts/rx.time.js +162 -178
- data/vendor/assets/javascripts/rx.time.min.js +3 -1
- data/vendor/assets/javascripts/rx.virtualtime.js +30 -30
- data/vendor/assets/javascripts/rx.virtualtime.min.js +3 -1
- metadata +2 -6
- data/vendor/assets/javascripts/rx.core.compat.js +0 -2548
- data/vendor/assets/javascripts/rx.core.compat.min.js +0 -1
- data/vendor/assets/javascripts/rx.core.js +0 -2430
- data/vendor/assets/javascripts/rx.core.min.js +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fbaf663a13b0d028cdd5ef444c0885a0ae9aa02d
|
4
|
+
data.tar.gz: 31bda3c75000aad30233512aca7cda93f9af4314
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 707fefef6843721659217ba0d8350bddff0c31609bef8e4f348a4f4c4c27c65061f48218b393f85dcd688e92e16dec3fe22c21eff3e1ff15a7b84c3f47c59088
|
7
|
+
data.tar.gz: 404cb189038a5a78f22365b8111241f7b356b9624cacd15cab0d95c467b8eccc6097c3fb4f88ea4e768f9fe09ae7776417a3ef7b52a8040b50d57b3bef900c36
|
data/lib/rxjs/rails/version.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
|
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
4
|
var objectTypes = {
|
@@ -15,16 +15,15 @@
|
|
15
15
|
freeModule = objectTypes[typeof module] && module && !module.nodeType && module,
|
16
16
|
moduleExports = freeModule && freeModule.exports === freeExports && freeExports,
|
17
17
|
freeGlobal = objectTypes[typeof global] && global;
|
18
|
-
|
18
|
+
|
19
19
|
if (freeGlobal && (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal)) {
|
20
20
|
root = freeGlobal;
|
21
21
|
}
|
22
22
|
|
23
23
|
// Because of build optimizers
|
24
24
|
if (typeof define === 'function' && define.amd) {
|
25
|
-
define(['rx'
|
26
|
-
|
27
|
-
return root.Rx;
|
25
|
+
define(['rx'], function (Rx, exports) {
|
26
|
+
return factory(root, exports, Rx);
|
28
27
|
});
|
29
28
|
} else if (typeof module === 'object' && module && module.exports === freeExports) {
|
30
29
|
module.exports = factory(root, module.exports, require('./rx'));
|
@@ -32,26 +31,27 @@
|
|
32
31
|
root.Rx = factory(root, {}, root.Rx);
|
33
32
|
}
|
34
33
|
}.call(this, function (root, exp, Rx, undefined) {
|
35
|
-
|
36
|
-
// References
|
37
|
-
var Observable = Rx.Observable,
|
38
|
-
observableProto = Observable.prototype,
|
39
|
-
CompositeDisposable = Rx.CompositeDisposable,
|
40
|
-
AnonymousObservable = Rx.AnonymousObservable,
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
34
|
+
|
35
|
+
// References
|
36
|
+
var Observable = Rx.Observable,
|
37
|
+
observableProto = Observable.prototype,
|
38
|
+
CompositeDisposable = Rx.CompositeDisposable,
|
39
|
+
AnonymousObservable = Rx.AnonymousObservable,
|
40
|
+
disposableEmpty = Rx.Disposable.empty,
|
41
|
+
isEqual = Rx.internals.isEqual,
|
42
|
+
helpers = Rx.helpers,
|
43
|
+
not = helpers.not,
|
44
|
+
defaultComparer = helpers.defaultComparer,
|
45
|
+
identity = helpers.identity,
|
46
|
+
defaultSubComparer = helpers.defaultSubComparer,
|
47
|
+
isFunction = helpers.isFunction,
|
48
|
+
isPromise = helpers.isPromise,
|
49
|
+
observableFromPromise = Observable.fromPromise;
|
50
|
+
|
51
|
+
// Defaults
|
52
|
+
var argumentOutOfRange = 'Argument out of range',
|
53
|
+
sequenceContainsNoElements = "Sequence contains no elements.";
|
54
|
+
|
55
55
|
observableProto.finalValue = function () {
|
56
56
|
var source = this;
|
57
57
|
return new AnonymousObservable(function (observer) {
|
@@ -141,7 +141,7 @@
|
|
141
141
|
* 1 - res = source.reduce(function (acc, x) { return acc + x; });
|
142
142
|
* 2 - res = source.reduce(function (acc, x) { return acc + x; }, 0);
|
143
143
|
* @param {Function} accumulator An accumulator function to be invoked on each element.
|
144
|
-
* @param {Any} [seed] The initial accumulator value.
|
144
|
+
* @param {Any} [seed] The initial accumulator value.
|
145
145
|
* @returns {Observable} An observable sequence containing a single element with the final accumulator value.
|
146
146
|
*/
|
147
147
|
observableProto.reduce = function (accumulator) {
|
@@ -149,7 +149,7 @@
|
|
149
149
|
if (arguments.length === 2) {
|
150
150
|
hasSeed = true;
|
151
151
|
seed = arguments[1];
|
152
|
-
}
|
152
|
+
}
|
153
153
|
return hasSeed ? this.scan(seed, accumulator).startWith(seed).finalValue() : this.scan(accumulator).finalValue();
|
154
154
|
};
|
155
155
|
|
@@ -163,8 +163,8 @@
|
|
163
163
|
*/
|
164
164
|
observableProto.some = observableProto.any = function (predicate, thisArg) {
|
165
165
|
var source = this;
|
166
|
-
return predicate ?
|
167
|
-
source.where(predicate, thisArg).any() :
|
166
|
+
return predicate ?
|
167
|
+
source.where(predicate, thisArg).any() :
|
168
168
|
new AnonymousObservable(function (observer) {
|
169
169
|
return source.subscribe(function () {
|
170
170
|
observer.onNext(true);
|
@@ -186,7 +186,7 @@
|
|
186
186
|
|
187
187
|
/**
|
188
188
|
* Determines whether all elements of an observable sequence satisfy a condition.
|
189
|
-
*
|
189
|
+
*
|
190
190
|
* 1 - res = source.all(function (value) { return value.length > 3; });
|
191
191
|
* @memberOf Observable#
|
192
192
|
* @param {Function} [predicate] A function to test each element for a condition.
|
@@ -201,21 +201,39 @@
|
|
201
201
|
});
|
202
202
|
};
|
203
203
|
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
204
|
+
/**
|
205
|
+
* Determines whether an observable sequence contains a specified element with an optional equality comparer.
|
206
|
+
* @param searchElement The value to locate in the source sequence.
|
207
|
+
* @param {Number} [fromIndex] An equality comparer to compare elements.
|
208
|
+
* @returns {Observable} An observable sequence containing a single element determining whether the source sequence contains an element that has the specified value from the given index.
|
209
|
+
*/
|
210
|
+
observableProto.contains = function (searchElement, fromIndex) {
|
211
|
+
var source = this;
|
212
|
+
function comparer(a, b) {
|
213
|
+
return (a === 0 && b === 0) || (a === b || (isNaN(a) && isNaN(b)));
|
214
|
+
}
|
215
|
+
return new AnonymousObservable(function (observer) {
|
216
|
+
var i = 0, n = +fromIndex || 0;
|
217
|
+
Math.abs(n) === Infinity && (n = 0);
|
218
|
+
if (n < 0) {
|
219
|
+
observer.onNext(false);
|
220
|
+
observer.onCompleted();
|
221
|
+
return disposableEmpty;
|
222
|
+
}
|
223
|
+
return source.subscribe(
|
224
|
+
function (x) {
|
225
|
+
if (i++ >= n && comparer(x, searchElement)) {
|
226
|
+
observer.onNext(true);
|
227
|
+
observer.onCompleted();
|
228
|
+
}
|
229
|
+
},
|
230
|
+
observer.onError.bind(observer),
|
231
|
+
function () {
|
232
|
+
observer.onNext(false);
|
233
|
+
observer.onCompleted();
|
234
|
+
});
|
235
|
+
});
|
236
|
+
};
|
219
237
|
|
220
238
|
/**
|
221
239
|
* Returns an observable sequence containing a value that represents how many elements in the specified observable sequence satisfy a condition if provided, else the count of items.
|
@@ -223,7 +241,7 @@
|
|
223
241
|
* res = source.count();
|
224
242
|
* res = source.count(function (x) { return x > 3; });
|
225
243
|
* @param {Function} [predicate]A function to test each element for a condition.
|
226
|
-
* @param {Any} [thisArg] Object to use as this when executing callback.
|
244
|
+
* @param {Any} [thisArg] Object to use as this when executing callback.
|
227
245
|
* @returns {Observable} An observable sequence containing a single element with a number that represents how many elements in the input sequence satisfy the condition in the predicate function if provided, else the count of items in the sequence.
|
228
246
|
*/
|
229
247
|
observableProto.count = function (predicate, thisArg) {
|
@@ -234,17 +252,48 @@
|
|
234
252
|
});
|
235
253
|
};
|
236
254
|
|
255
|
+
/**
|
256
|
+
* Returns the first index at which a given element can be found in the observable sequence, or -1 if it is not present.
|
257
|
+
* @param {Any} searchElement Element to locate in the array.
|
258
|
+
* @param {Number} [fromIndex] The index to start the search. If not specified, defaults to 0.
|
259
|
+
* @returns {Observable} And observable sequence containing the first index at which a given element can be found in the observable sequence, or -1 if it is not present.
|
260
|
+
*/
|
261
|
+
observableProto.indexOf = function(searchElement, fromIndex) {
|
262
|
+
var source = this;
|
263
|
+
return new AnonymousObservable(function (observer) {
|
264
|
+
var i = 0, n = +fromIndex || 0;
|
265
|
+
Math.abs(n) === Infinity && (n = 0);
|
266
|
+
if (n < 0) {
|
267
|
+
observer.onNext(-1);
|
268
|
+
observer.onCompleted();
|
269
|
+
return disposableEmpty;
|
270
|
+
}
|
271
|
+
return source.subscribe(
|
272
|
+
function (x) {
|
273
|
+
if (i >= n && x === searchElement) {
|
274
|
+
observer.onNext(i);
|
275
|
+
observer.onCompleted();
|
276
|
+
}
|
277
|
+
i++;
|
278
|
+
},
|
279
|
+
observer.onError.bind(observer),
|
280
|
+
function () {
|
281
|
+
observer.onNext(-1);
|
282
|
+
observer.onCompleted();
|
283
|
+
});
|
284
|
+
});
|
285
|
+
};
|
237
286
|
/**
|
238
287
|
* Computes the sum of a sequence of values that are obtained by invoking an optional transform function on each element of the input sequence, else if not specified computes the sum on each item in the sequence.
|
239
288
|
* @example
|
240
289
|
* var res = source.sum();
|
241
290
|
* var res = source.sum(function (x) { return x.value; });
|
242
291
|
* @param {Function} [selector] A transform function to apply to each element.
|
243
|
-
* @param {Any} [thisArg] Object to use as this when executing callback.
|
292
|
+
* @param {Any} [thisArg] Object to use as this when executing callback.
|
244
293
|
* @returns {Observable} An observable sequence containing a single element with the sum of the values in the source sequence.
|
245
|
-
*/
|
294
|
+
*/
|
246
295
|
observableProto.sum = function (keySelector, thisArg) {
|
247
|
-
return keySelector && isFunction(keySelector) ?
|
296
|
+
return keySelector && isFunction(keySelector) ?
|
248
297
|
this.map(keySelector, thisArg).sum() :
|
249
298
|
this.aggregate(0, function (prev, curr) {
|
250
299
|
return prev + curr;
|
@@ -259,7 +308,7 @@
|
|
259
308
|
* @param {Function} keySelector Key selector function.
|
260
309
|
* @param {Function} [comparer] Comparer used to compare key values.
|
261
310
|
* @returns {Observable} An observable sequence containing a list of zero or more elements that have a minimum key value.
|
262
|
-
*/
|
311
|
+
*/
|
263
312
|
observableProto.minBy = function (keySelector, comparer) {
|
264
313
|
comparer || (comparer = defaultSubComparer);
|
265
314
|
return extremaBy(this, keySelector, function (x, y) {
|
@@ -315,7 +364,7 @@
|
|
315
364
|
* var res = res = source.average();
|
316
365
|
* var res = res = source.average(function (x) { return x.value; });
|
317
366
|
* @param {Function} [selector] A transform function to apply to each element.
|
318
|
-
* @param {Any} [thisArg] Object to use as this when executing callback.
|
367
|
+
* @param {Any} [thisArg] Object to use as this when executing callback.
|
319
368
|
* @returns {Observable} An observable sequence containing a single element with the average of the sequence of values.
|
320
369
|
*/
|
321
370
|
observableProto.average = function (keySelector, thisArg) {
|
@@ -361,7 +410,7 @@
|
|
361
410
|
|
362
411
|
/**
|
363
412
|
* Determines whether two sequences are equal by comparing the elements pairwise using a specified equality comparer.
|
364
|
-
*
|
413
|
+
*
|
365
414
|
* @example
|
366
415
|
* var res = res = source.sequenceEqual([1,2,3]);
|
367
416
|
* var res = res = source.sequenceEqual([{ value: 42 }], function (x, y) { return x.value === y.value; });
|
@@ -491,7 +540,7 @@
|
|
491
540
|
* @param {Number} index The zero-based index of the element to retrieve.
|
492
541
|
* @param [defaultValue] The default value if the index is outside the bounds of the source sequence.
|
493
542
|
* @returns {Observable} An observable sequence that produces the element at the specified position in the source sequence, or a default value if the index is outside the bounds of the source sequence.
|
494
|
-
*/
|
543
|
+
*/
|
495
544
|
observableProto.elementAtOrDefault = function (index, defaultValue) {
|
496
545
|
return elementAtOrDefault(this, index, true, defaultValue);
|
497
546
|
};
|
@@ -523,7 +572,7 @@
|
|
523
572
|
* var res = res = source.single();
|
524
573
|
* var res = res = source.single(function (x) { return x === 42; });
|
525
574
|
* @param {Function} [predicate] A predicate function to evaluate for elements in the source sequence.
|
526
|
-
* @param {Any} [thisArg] Object to use as `this` when executing the predicate.
|
575
|
+
* @param {Any} [thisArg] Object to use as `this` when executing the predicate.
|
527
576
|
* @returns {Observable} Sequence containing the single element in the observable sequence that satisfies the condition in the predicate.
|
528
577
|
*/
|
529
578
|
observableProto.single = function (predicate, thisArg) {
|
@@ -542,7 +591,7 @@
|
|
542
591
|
* @memberOf Observable#
|
543
592
|
* @param {Function} predicate A predicate function to evaluate for elements in the source sequence.
|
544
593
|
* @param [defaultValue] The default value if the index is outside the bounds of the source sequence.
|
545
|
-
* @param {Any} [thisArg] Object to use as `this` when executing the predicate.
|
594
|
+
* @param {Any} [thisArg] Object to use as `this` when executing the predicate.
|
546
595
|
* @returns {Observable} Sequence containing the single element in the observable sequence that satisfies the condition in the predicate, or a default value if no such element exists.
|
547
596
|
*/
|
548
597
|
observableProto.singleOrDefault = function (predicate, defaultValue, thisArg) {
|
@@ -550,6 +599,7 @@
|
|
550
599
|
this.where(predicate, thisArg).singleOrDefault(null, defaultValue) :
|
551
600
|
singleOrDefaultAsync(this, true, defaultValue);
|
552
601
|
};
|
602
|
+
|
553
603
|
function firstOrDefaultAsync(source, hasDefault, defaultValue) {
|
554
604
|
return new AnonymousObservable(function (observer) {
|
555
605
|
return source.subscribe(function (x) {
|
@@ -572,9 +622,9 @@
|
|
572
622
|
* var res = res = source.first();
|
573
623
|
* var res = res = source.first(function (x) { return x > 3; });
|
574
624
|
* @param {Function} [predicate] A predicate function to evaluate for elements in the source sequence.
|
575
|
-
* @param {Any} [thisArg] Object to use as `this` when executing the predicate.
|
625
|
+
* @param {Any} [thisArg] Object to use as `this` when executing the predicate.
|
576
626
|
* @returns {Observable} Sequence containing the first element in the observable sequence that satisfies the condition in the predicate if provided, else the first item in the sequence.
|
577
|
-
*/
|
627
|
+
*/
|
578
628
|
observableProto.first = function (predicate, thisArg) {
|
579
629
|
return predicate ?
|
580
630
|
this.where(predicate, thisArg).first() :
|
@@ -583,12 +633,12 @@
|
|
583
633
|
|
584
634
|
/**
|
585
635
|
* Returns the first element of an observable sequence that satisfies the condition in the predicate, or a default value if no such element exists.
|
586
|
-
* @example
|
636
|
+
* @example
|
587
637
|
* var res = res = source.firstOrDefault();
|
588
638
|
* var res = res = source.firstOrDefault(function (x) { return x > 3; });
|
589
639
|
* var res = source.firstOrDefault(function (x) { return x > 3; }, 0);
|
590
640
|
* var res = source.firstOrDefault(null, 0);
|
591
|
-
* @param {Function} [predicate] A predicate function to evaluate for elements in the source sequence.
|
641
|
+
* @param {Function} [predicate] A predicate function to evaluate for elements in the source sequence.
|
592
642
|
* @param {Any} [defaultValue] The default value if no such element exists. If not specified, defaults to null.
|
593
643
|
* @param {Any} [thisArg] Object to use as `this` when executing the predicate.
|
594
644
|
* @returns {Observable} Sequence containing the first element in the observable sequence that satisfies the condition in the predicate, or a default value if no such element exists.
|
@@ -622,7 +672,7 @@
|
|
622
672
|
* var res = source.last();
|
623
673
|
* var res = source.last(function (x) { return x > 3; });
|
624
674
|
* @param {Function} [predicate] A predicate function to evaluate for elements in the source sequence.
|
625
|
-
* @param {Any} [thisArg] Object to use as `this` when executing the predicate.
|
675
|
+
* @param {Any} [thisArg] Object to use as `this` when executing the predicate.
|
626
676
|
* @returns {Observable} Sequence containing the last element in the observable sequence that satisfies the condition in the predicate.
|
627
677
|
*/
|
628
678
|
observableProto.last = function (predicate, thisArg) {
|
@@ -640,11 +690,11 @@
|
|
640
690
|
* var res = source.lastOrDefault(null, 0);
|
641
691
|
* @param {Function} [predicate] A predicate function to evaluate for elements in the source sequence.
|
642
692
|
* @param [defaultValue] The default value if no such element exists. If not specified, defaults to null.
|
643
|
-
* @param {Any} [thisArg] Object to use as `this` when executing the predicate.
|
693
|
+
* @param {Any} [thisArg] Object to use as `this` when executing the predicate.
|
644
694
|
* @returns {Observable} Sequence containing the last element in the observable sequence that satisfies the condition in the predicate, or a default value if no such element exists.
|
645
695
|
*/
|
646
696
|
observableProto.lastOrDefault = function (predicate, defaultValue, thisArg) {
|
647
|
-
return predicate ?
|
697
|
+
return predicate ?
|
648
698
|
this.where(predicate, thisArg).lastOrDefault(null, defaultValue) :
|
649
699
|
lastOrDefaultAsync(this, true, defaultValue);
|
650
700
|
};
|
@@ -670,13 +720,13 @@
|
|
670
720
|
observer.onNext(yieldIndex ? -1 : undefined);
|
671
721
|
observer.onCompleted();
|
672
722
|
});
|
673
|
-
});
|
723
|
+
});
|
674
724
|
}
|
675
725
|
|
676
726
|
/**
|
677
727
|
* Searches for an element that matches the conditions defined by the specified predicate, and returns the first occurrence within the entire Observable sequence.
|
678
728
|
* @param {Function} predicate The predicate that defines the conditions of the element to search for.
|
679
|
-
* @param {Any} [thisArg] Object to use as `this` when executing the predicate.
|
729
|
+
* @param {Any} [thisArg] Object to use as `this` when executing the predicate.
|
680
730
|
* @returns {Observable} An Observable sequence with the first element that matches the conditions defined by the specified predicate, if found; otherwise, undefined.
|
681
731
|
*/
|
682
732
|
observableProto.find = function (predicate, thisArg) {
|
@@ -684,10 +734,10 @@
|
|
684
734
|
};
|
685
735
|
|
686
736
|
/**
|
687
|
-
* Searches for an element that matches the conditions defined by the specified predicate, and returns
|
688
|
-
* an Observable sequence with the zero-based index of the first occurrence within the entire Observable sequence.
|
737
|
+
* Searches for an element that matches the conditions defined by the specified predicate, and returns
|
738
|
+
* an Observable sequence with the zero-based index of the first occurrence within the entire Observable sequence.
|
689
739
|
* @param {Function} predicate The predicate that defines the conditions of the element to search for.
|
690
|
-
* @param {Any} [thisArg] Object to use as `this` when executing the predicate.
|
740
|
+
* @param {Any} [thisArg] Object to use as `this` when executing the predicate.
|
691
741
|
* @returns {Observable} An Observable sequence with the zero-based index of the first occurrence of an element that matches the conditions defined by match, if found; otherwise, –1.
|
692
742
|
*/
|
693
743
|
observableProto.findIndex = function (predicate, thisArg) {
|
@@ -742,7 +792,7 @@
|
|
742
792
|
} catch (e) {
|
743
793
|
observer.onError(e);
|
744
794
|
return;
|
745
|
-
}
|
795
|
+
}
|
746
796
|
}
|
747
797
|
|
748
798
|
m.set(key, element);
|
@@ -756,5 +806,5 @@
|
|
756
806
|
};
|
757
807
|
}
|
758
808
|
|
759
|
-
return Rx;
|
760
|
-
}));
|
809
|
+
return Rx;
|
810
|
+
}));
|
@@ -1 +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={"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"],function(b,d){return a(c,d,b)}):"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,b,c){return new p(function(d){var e=!1,f=null,g=[];return a.subscribe(function(a){var h,i;try{i=b(a)}catch(j){return void d.onError(j)}if(h=0,e)try{h=c(i,f)}catch(k){return void d.onError(k)}else e=!0,f=i;h>0&&(f=i,g=[]),h>=0&&g.push(a)},d.onError.bind(d),function(){d.onNext(g),d.onCompleted()})})}function f(a){if(0===a.length)throw new Error(A);return a[0]}function g(a,b,c){return new p(function(d){var e=0,f=b.length;return a.subscribe(function(a){var g=!1;try{f>e&&(g=c(a,b[e++]))}catch(h){return void d.onError(h)}g||(d.onNext(!1),d.onCompleted())},d.onError.bind(d),function(){d.onNext(e===f),d.onCompleted()})})}function h(a,b,c,d){if(0>b)throw new Error(z);return new p(function(e){var f=b;return a.subscribe(function(a){0===f&&(e.onNext(a),e.onCompleted()),f--},e.onError.bind(e),function(){c?(e.onNext(d),e.onCompleted()):e.onError(new Error(z))})})}function i(a,b,c){return new p(function(d){var e=c,f=!1;return a.subscribe(function(a){f?d.onError(new Error("Sequence contains more than one element")):(e=a,f=!0)},d.onError.bind(d),function(){f||b?(d.onNext(e),d.onCompleted()):d.onError(new Error(A))})})}function j(a,b,c){return new p(function(d){return a.subscribe(function(a){d.onNext(a),d.onCompleted()},d.onError.bind(d),function(){b?(d.onNext(c),d.onCompleted()):d.onError(new Error(A))})})}function k(a,b,c){return new p(function(d){var e=c,f=!1;return a.subscribe(function(a){e=a,f=!0},d.onError.bind(d),function(){f||b?(d.onNext(e),d.onCompleted()):d.onError(new Error(A))})})}function l(a,b,c,e){return new p(function(f){var g=0;return a.subscribe(function(d){var h;try{h=b.call(c,d,g,a)}catch(i){return void f.onError(i)}h?(f.onNext(e?g:d),f.onCompleted()):g++},f.onError.bind(f),function(){f.onNext(e?-1:d),f.onCompleted()})})}var m=c.Observable,n=m.prototype,o=c.CompositeDisposable,p=c.AnonymousObservable,q=c.Disposable.empty,r=(c.internals.isEqual,c.helpers),s=r.not,t=r.defaultComparer,u=r.identity,v=r.defaultSubComparer,w=r.isFunction,x=r.isPromise,y=m.fromPromise,z="Argument out of range",A="Sequence contains no elements.";return n.finalValue=function(){var a=this;return new p(function(b){var c,d=!1;return a.subscribe(function(a){d=!0,c=a},b.onError.bind(b),function(){d?(b.onNext(c),b.onCompleted()):b.onError(new Error(A))})})},n.aggregate=function(){var a,b,c;return 2===arguments.length?(a=arguments[0],b=!0,c=arguments[1]):c=arguments[0],b?this.scan(a,c).startWith(a).finalValue():this.scan(c).finalValue()},n.reduce=function(a){var b,c;return 2===arguments.length&&(c=!0,b=arguments[1]),c?this.scan(b,a).startWith(b).finalValue():this.scan(a).finalValue()},n.some=n.any=function(a,b){var c=this;return a?c.where(a,b).any():new p(function(a){return c.subscribe(function(){a.onNext(!0),a.onCompleted()},a.onError.bind(a),function(){a.onNext(!1),a.onCompleted()})})},n.isEmpty=function(){return this.any().map(s)},n.every=n.all=function(a,b){return this.where(function(b){return!a(b)},b).any().select(function(a){return!a})},n.contains=function(a,b){function c(a,b){return 0===a&&0===b||a===b||isNaN(a)&&isNaN(b)}var d=this;return new p(function(e){var f=0,g=+b||0;return 1/0===Math.abs(g)&&(g=0),0>g?(e.onNext(!1),e.onCompleted(),q):d.subscribe(function(b){f++>=g&&c(b,a)&&(e.onNext(!0),e.onCompleted())},e.onError.bind(e),function(){e.onNext(!1),e.onCompleted()})})},n.count=function(a,b){return a?this.where(a,b).count():this.aggregate(0,function(a){return a+1})},n.indexOf=function(a,b){var c=this;return new p(function(d){var e=0,f=+b||0;return 1/0===Math.abs(f)&&(f=0),0>f?(d.onNext(-1),d.onCompleted(),q):c.subscribe(function(b){e>=f&&b===a&&(d.onNext(e),d.onCompleted()),e++},d.onError.bind(d),function(){d.onNext(-1),d.onCompleted()})})},n.sum=function(a,b){return a&&w(a)?this.map(a,b).sum():this.aggregate(0,function(a,b){return a+b})},n.minBy=function(a,b){return b||(b=v),e(this,a,function(a,c){return-1*b(a,c)})},n.min=function(a){return this.minBy(u,a).select(function(a){return f(a)})},n.maxBy=function(a,b){return b||(b=v),e(this,a,b)},n.max=function(a){return this.maxBy(u,a).select(function(a){return f(a)})},n.average=function(a,b){return a?this.select(a,b).average():this.scan({sum:0,count:0},function(a,b){return{sum:a.sum+b,count:a.count+1}}).finalValue().select(function(a){if(0===a.count)throw new Error("The input sequence was empty");return a.sum/a.count})},n.sequenceEqual=function(a,b){var c=this;return b||(b=t),Array.isArray(a)?g(c,a,b):new p(function(d){var e=!1,f=!1,g=[],h=[],i=c.subscribe(function(a){var c,e;if(h.length>0){e=h.shift();try{c=b(e,a)}catch(i){return void d.onError(i)}c||(d.onNext(!1),d.onCompleted())}else f?(d.onNext(!1),d.onCompleted()):g.push(a)},d.onError.bind(d),function(){e=!0,0===g.length&&(h.length>0?(d.onNext(!1),d.onCompleted()):f&&(d.onNext(!0),d.onCompleted()))});x(a)&&(a=y(a));var j=a.subscribe(function(a){var c;if(g.length>0){var f=g.shift();try{c=b(f,a)}catch(i){return void d.onError(i)}c||(d.onNext(!1),d.onCompleted())}else e?(d.onNext(!1),d.onCompleted()):h.push(a)},d.onError.bind(d),function(){f=!0,0===h.length&&(g.length>0?(d.onNext(!1),d.onCompleted()):e&&(d.onNext(!0),d.onCompleted()))});return new o(i,j)})},n.elementAt=function(a){return h(this,a,!1)},n.elementAtOrDefault=function(a,b){return h(this,a,!0,b)},n.single=function(a,b){return a&&w(a)?this.where(a,b).single():i(this,!1)},n.singleOrDefault=function(a,b,c){return a&&w(a)?this.where(a,c).singleOrDefault(null,b):i(this,!0,b)},n.first=function(a,b){return a?this.where(a,b).first():j(this,!1)},n.firstOrDefault=function(a,b){return a?this.where(a).firstOrDefault(null,b):j(this,!0,b)},n.last=function(a,b){return a?this.where(a,b).last():k(this,!1)},n.lastOrDefault=function(a,b,c){return a?this.where(a,c).lastOrDefault(null,b):k(this,!0,b)},n.find=function(a,b){return l(this,a,b,!1)},n.findIndex=function(a,b){return l(this,a,b,!0)},a.Set&&(n.toSet=function(){var b=this;return new p(function(c){var d=new a.Set;return b.subscribe(d.add.bind(d),c.onError.bind(c),function(){c.onNext(d),c.onCompleted()})})}),a.Map&&(n.toMap=function(b,c){var d=this;return new p(function(e){var f=new a.Map;return d.subscribe(function(a){var d;try{d=b(a)}catch(g){return void e.onError(g)}var h=a;if(c)try{h=c(a)}catch(g){return void e.onError(g)}f.set(d,h)},e.onError.bind(e),function(){e.onNext(f),e.onCompleted()})})}),c});
|
3
|
+
//# sourceMappingURL=rx.aggregates.map
|