rxjs-rails 2.3.11 → 2.3.14
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 +54 -66
- data/vendor/assets/javascripts/rx.aggregates.min.js +1 -1
- data/vendor/assets/javascripts/rx.all.compat.js +326 -359
- data/vendor/assets/javascripts/rx.all.compat.min.js +3 -3
- data/vendor/assets/javascripts/rx.all.js +326 -359
- data/vendor/assets/javascripts/rx.all.min.js +3 -3
- data/vendor/assets/javascripts/rx.async.compat.js +21 -33
- data/vendor/assets/javascripts/rx.async.compat.min.js +1 -1
- data/vendor/assets/javascripts/rx.async.js +21 -33
- data/vendor/assets/javascripts/rx.async.min.js +1 -1
- data/vendor/assets/javascripts/rx.compat.js +242 -363
- data/vendor/assets/javascripts/rx.compat.min.js +2 -2
- data/vendor/assets/javascripts/rx.experimental.js +112 -0
- data/vendor/assets/javascripts/rx.experimental.min.js +1 -1
- data/vendor/assets/javascripts/rx.js +242 -363
- data/vendor/assets/javascripts/rx.lite.compat.js +184 -295
- data/vendor/assets/javascripts/rx.lite.compat.min.js +2 -2
- data/vendor/assets/javascripts/rx.lite.js +184 -295
- 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.js +269 -252
- data/vendor/assets/javascripts/rx.testing.min.js +1 -1
- data/vendor/assets/javascripts/rx.time.js +1 -1
- data/vendor/assets/javascripts/rx.time.min.js +1 -1
- metadata +2 -2
@@ -307,7 +307,7 @@
|
|
307
307
|
}
|
308
308
|
}
|
309
309
|
var size = 0;
|
310
|
-
result = true;
|
310
|
+
var result = true;
|
311
311
|
|
312
312
|
// add `a` and `b` to the stack of traversed objects
|
313
313
|
stackA.push(a);
|
@@ -693,30 +693,30 @@
|
|
693
693
|
return RefCountDisposable;
|
694
694
|
})();
|
695
695
|
|
696
|
-
|
697
|
-
|
698
|
-
|
699
|
-
|
700
|
-
|
701
|
-
|
702
|
-
|
703
|
-
|
696
|
+
var ScheduledItem = Rx.internals.ScheduledItem = function (scheduler, state, action, dueTime, comparer) {
|
697
|
+
this.scheduler = scheduler;
|
698
|
+
this.state = state;
|
699
|
+
this.action = action;
|
700
|
+
this.dueTime = dueTime;
|
701
|
+
this.comparer = comparer || defaultSubComparer;
|
702
|
+
this.disposable = new SingleAssignmentDisposable();
|
703
|
+
}
|
704
704
|
|
705
|
-
|
706
|
-
|
707
|
-
|
705
|
+
ScheduledItem.prototype.invoke = function () {
|
706
|
+
this.disposable.setDisposable(this.invokeCore());
|
707
|
+
};
|
708
708
|
|
709
|
-
|
710
|
-
|
711
|
-
|
709
|
+
ScheduledItem.prototype.compareTo = function (other) {
|
710
|
+
return this.comparer(this.dueTime, other.dueTime);
|
711
|
+
};
|
712
712
|
|
713
|
-
|
714
|
-
|
715
|
-
|
713
|
+
ScheduledItem.prototype.isCancelled = function () {
|
714
|
+
return this.disposable.isDisposed;
|
715
|
+
};
|
716
716
|
|
717
|
-
|
718
|
-
|
719
|
-
|
717
|
+
ScheduledItem.prototype.invokeCore = function () {
|
718
|
+
return this.action(this.scheduler, this.state);
|
719
|
+
};
|
720
720
|
|
721
721
|
/** Provides a set of static properties to access commonly used schedulers. */
|
722
722
|
var Scheduler = Rx.Scheduler = (function () {
|
@@ -728,54 +728,6 @@
|
|
728
728
|
this._scheduleAbsolute = scheduleAbsolute;
|
729
729
|
}
|
730
730
|
|
731
|
-
function invokeRecImmediate(scheduler, pair) {
|
732
|
-
var state = pair.first, action = pair.second, group = new CompositeDisposable(),
|
733
|
-
recursiveAction = function (state1) {
|
734
|
-
action(state1, function (state2) {
|
735
|
-
var isAdded = false, isDone = false,
|
736
|
-
d = scheduler.scheduleWithState(state2, function (scheduler1, state3) {
|
737
|
-
if (isAdded) {
|
738
|
-
group.remove(d);
|
739
|
-
} else {
|
740
|
-
isDone = true;
|
741
|
-
}
|
742
|
-
recursiveAction(state3);
|
743
|
-
return disposableEmpty;
|
744
|
-
});
|
745
|
-
if (!isDone) {
|
746
|
-
group.add(d);
|
747
|
-
isAdded = true;
|
748
|
-
}
|
749
|
-
});
|
750
|
-
};
|
751
|
-
recursiveAction(state);
|
752
|
-
return group;
|
753
|
-
}
|
754
|
-
|
755
|
-
function invokeRecDate(scheduler, pair, method) {
|
756
|
-
var state = pair.first, action = pair.second, group = new CompositeDisposable(),
|
757
|
-
recursiveAction = function (state1) {
|
758
|
-
action(state1, function (state2, dueTime1) {
|
759
|
-
var isAdded = false, isDone = false,
|
760
|
-
d = scheduler[method].call(scheduler, state2, dueTime1, function (scheduler1, state3) {
|
761
|
-
if (isAdded) {
|
762
|
-
group.remove(d);
|
763
|
-
} else {
|
764
|
-
isDone = true;
|
765
|
-
}
|
766
|
-
recursiveAction(state3);
|
767
|
-
return disposableEmpty;
|
768
|
-
});
|
769
|
-
if (!isDone) {
|
770
|
-
group.add(d);
|
771
|
-
isAdded = true;
|
772
|
-
}
|
773
|
-
});
|
774
|
-
};
|
775
|
-
recursiveAction(state);
|
776
|
-
return group;
|
777
|
-
}
|
778
|
-
|
779
731
|
function invokeAction(scheduler, action) {
|
780
732
|
action();
|
781
733
|
return disposableEmpty;
|
@@ -1095,34 +1047,34 @@
|
|
1095
1047
|
return currentScheduler;
|
1096
1048
|
}());
|
1097
1049
|
|
1098
|
-
|
1099
|
-
|
1100
|
-
|
1101
|
-
|
1102
|
-
|
1103
|
-
|
1104
|
-
|
1105
|
-
|
1106
|
-
|
1107
|
-
|
1050
|
+
var SchedulePeriodicRecursive = Rx.internals.SchedulePeriodicRecursive = (function () {
|
1051
|
+
function tick(command, recurse) {
|
1052
|
+
recurse(0, this._period);
|
1053
|
+
try {
|
1054
|
+
this._state = this._action(this._state);
|
1055
|
+
} catch (e) {
|
1056
|
+
this._cancel.dispose();
|
1057
|
+
throw e;
|
1058
|
+
}
|
1059
|
+
}
|
1108
1060
|
|
1109
|
-
|
1110
|
-
|
1111
|
-
|
1112
|
-
|
1113
|
-
|
1114
|
-
|
1061
|
+
function SchedulePeriodicRecursive(scheduler, state, period, action) {
|
1062
|
+
this._scheduler = scheduler;
|
1063
|
+
this._state = state;
|
1064
|
+
this._period = period;
|
1065
|
+
this._action = action;
|
1066
|
+
}
|
1115
1067
|
|
1116
|
-
|
1117
|
-
|
1118
|
-
|
1119
|
-
|
1068
|
+
SchedulePeriodicRecursive.prototype.start = function () {
|
1069
|
+
var d = new SingleAssignmentDisposable();
|
1070
|
+
this._cancel = d;
|
1071
|
+
d.setDisposable(this._scheduler.scheduleRecursiveWithRelativeAndState(0, this._period, tick.bind(this)));
|
1120
1072
|
|
1121
|
-
|
1122
|
-
|
1073
|
+
return d;
|
1074
|
+
};
|
1123
1075
|
|
1124
|
-
|
1125
|
-
|
1076
|
+
return SchedulePeriodicRecursive;
|
1077
|
+
}());
|
1126
1078
|
|
1127
1079
|
var scheduleMethod, clearMethod = noop;
|
1128
1080
|
var localTimer = (function () {
|
@@ -1360,14 +1312,14 @@
|
|
1360
1312
|
function _acceptObservable(observer) { return observer.onError(this.exception); }
|
1361
1313
|
function toString () { return 'OnError(' + this.exception + ')'; }
|
1362
1314
|
|
1363
|
-
return function (
|
1315
|
+
return function (e) {
|
1364
1316
|
var notification = new Notification('E');
|
1365
|
-
notification.exception =
|
1317
|
+
notification.exception = e;
|
1366
1318
|
notification._accept = _accept;
|
1367
1319
|
notification._acceptObservable = _acceptObservable;
|
1368
1320
|
notification.toString = toString;
|
1369
1321
|
return notification;
|
1370
|
-
|
1322
|
+
};
|
1371
1323
|
}());
|
1372
1324
|
|
1373
1325
|
/**
|
@@ -1376,17 +1328,17 @@
|
|
1376
1328
|
*/
|
1377
1329
|
var notificationCreateOnCompleted = Notification.createOnCompleted = (function () {
|
1378
1330
|
|
1379
|
-
|
1380
|
-
|
1381
|
-
|
1331
|
+
function _accept (onNext, onError, onCompleted) { return onCompleted(); }
|
1332
|
+
function _acceptObservable(observer) { return observer.onCompleted(); }
|
1333
|
+
function toString () { return 'OnCompleted()'; }
|
1382
1334
|
|
1383
|
-
|
1384
|
-
|
1385
|
-
|
1386
|
-
|
1387
|
-
|
1388
|
-
|
1389
|
-
|
1335
|
+
return function () {
|
1336
|
+
var notification = new Notification('C');
|
1337
|
+
notification._accept = _accept;
|
1338
|
+
notification._acceptObservable = _acceptObservable;
|
1339
|
+
notification.toString = toString;
|
1340
|
+
return notification;
|
1341
|
+
};
|
1390
1342
|
}());
|
1391
1343
|
|
1392
1344
|
var Enumerator = Rx.internals.Enumerator = function (next) {
|
@@ -1936,7 +1888,7 @@
|
|
1936
1888
|
* @param {Any} [thisArg] The context to use calling the mapFn if provided.
|
1937
1889
|
* @param {Scheduler} [scheduler] Optional scheduler to use for scheduling. If not provided, defaults to Scheduler.currentThread.
|
1938
1890
|
*/
|
1939
|
-
Observable.from = function (iterable, mapFn, thisArg, scheduler) {
|
1891
|
+
var observableFrom = Observable.from = function (iterable, mapFn, thisArg, scheduler) {
|
1940
1892
|
if (iterable == null) {
|
1941
1893
|
throw new Error('iterable cannot be null.')
|
1942
1894
|
}
|
@@ -1954,7 +1906,13 @@
|
|
1954
1906
|
if (i < len || objIsIterable) {
|
1955
1907
|
var result;
|
1956
1908
|
if (objIsIterable) {
|
1957
|
-
var next
|
1909
|
+
var next;
|
1910
|
+
try {
|
1911
|
+
next = it.next();
|
1912
|
+
} catch (e) {
|
1913
|
+
observer.onError(e);
|
1914
|
+
return;
|
1915
|
+
}
|
1958
1916
|
if (next.done) {
|
1959
1917
|
observer.onCompleted();
|
1960
1918
|
return;
|
@@ -1962,7 +1920,7 @@
|
|
1962
1920
|
|
1963
1921
|
result = next.value;
|
1964
1922
|
} else {
|
1965
|
-
result = list[i];
|
1923
|
+
result = !!list.charAt ? list.charAt(i) : list[i];
|
1966
1924
|
}
|
1967
1925
|
|
1968
1926
|
if (mapFn && isCallable(mapFn)) {
|
@@ -2960,47 +2918,50 @@
|
|
2960
2918
|
});
|
2961
2919
|
};
|
2962
2920
|
|
2963
|
-
|
2964
|
-
|
2965
|
-
|
2966
|
-
|
2967
|
-
|
2968
|
-
|
2921
|
+
function concatMap(source, selector, thisArg) {
|
2922
|
+
return source.map(function (x, i) {
|
2923
|
+
var result = selector.call(thisArg, x, i, source);
|
2924
|
+
isPromise(result) && (result = observableFromPromise(result));
|
2925
|
+
(Array.isArray(result) || isIterable(result)) && (result = observableFrom(result));
|
2926
|
+
return result;
|
2927
|
+
}).concatAll();
|
2928
|
+
}
|
2969
2929
|
|
2970
|
-
|
2971
|
-
|
2972
|
-
|
2973
|
-
|
2974
|
-
|
2975
|
-
|
2976
|
-
|
2977
|
-
|
2978
|
-
|
2979
|
-
|
2980
|
-
|
2981
|
-
|
2982
|
-
|
2983
|
-
|
2984
|
-
|
2985
|
-
|
2986
|
-
|
2987
|
-
|
2988
|
-
|
2989
|
-
|
2990
|
-
|
2991
|
-
|
2992
|
-
|
2993
|
-
|
2994
|
-
|
2995
|
-
|
2996
|
-
|
2997
|
-
|
2998
|
-
|
2999
|
-
}
|
3000
|
-
|
3001
|
-
|
3002
|
-
|
3003
|
-
|
2930
|
+
/**
|
2931
|
+
* One of the Following:
|
2932
|
+
* Projects each element of an observable sequence to an observable sequence and merges the resulting observable sequences into one observable sequence.
|
2933
|
+
*
|
2934
|
+
* @example
|
2935
|
+
* var res = source.concatMap(function (x) { return Rx.Observable.range(0, x); });
|
2936
|
+
* Or:
|
2937
|
+
* Projects each element of an observable sequence to an observable sequence, invokes the result selector for the source element and each of the corresponding inner sequence's elements, and merges the results into one observable sequence.
|
2938
|
+
*
|
2939
|
+
* var res = source.concatMap(function (x) { return Rx.Observable.range(0, x); }, function (x, y) { return x + y; });
|
2940
|
+
* Or:
|
2941
|
+
* Projects each element of the source observable sequence to the other observable sequence and merges the resulting observable sequences into one observable sequence.
|
2942
|
+
*
|
2943
|
+
* var res = source.concatMap(Rx.Observable.fromArray([1,2,3]));
|
2944
|
+
* @param {Function} selector A transform function to apply to each element or an observable sequence to project each element from the
|
2945
|
+
* source sequence onto which could be either an observable or Promise.
|
2946
|
+
* @param {Function} [resultSelector] A transform function to apply to each element of the intermediate sequence.
|
2947
|
+
* @returns {Observable} An observable sequence whose elements are the result of invoking the one-to-many transform function collectionSelector on each element of the input sequence and then mapping each of those sequence elements and their corresponding source element to a result element.
|
2948
|
+
*/
|
2949
|
+
observableProto.selectConcat = observableProto.concatMap = function (selector, resultSelector, thisArg) {
|
2950
|
+
if (typeof selector === 'function' && typeof resultSelector === 'function') {
|
2951
|
+
return this.concatMap(function (x, i) {
|
2952
|
+
var selectorResult = selector(x, i);
|
2953
|
+
isPromise(selectorResult) && (selectorResult = observableFromPromise(selectorResult));
|
2954
|
+
(Array.isArray(selectorResult) || isIterable(selectorResult)) && (selectorResult = observableFrom(selectorResult));
|
2955
|
+
|
2956
|
+
return selectorResult.map(function (y, i2) {
|
2957
|
+
return resultSelector(x, y, i, i2);
|
2958
|
+
});
|
2959
|
+
});
|
2960
|
+
}
|
2961
|
+
return typeof selector === 'function' ?
|
2962
|
+
concatMap(this, selector, thisArg) :
|
2963
|
+
concatMap(this, function () { return selector; });
|
2964
|
+
};
|
3004
2965
|
|
3005
2966
|
/**
|
3006
2967
|
* Projects each element of an observable sequence into a new form by incorporating the element's index.
|
@@ -3034,48 +2995,50 @@
|
|
3034
2995
|
return this.map(function (x) { return x[prop]; });
|
3035
2996
|
};
|
3036
2997
|
|
3037
|
-
|
3038
|
-
|
3039
|
-
|
3040
|
-
|
3041
|
-
|
3042
|
-
|
2998
|
+
function flatMap(source, selector, thisArg) {
|
2999
|
+
return source.map(function (x, i) {
|
3000
|
+
var result = selector.call(thisArg, x, i, source);
|
3001
|
+
isPromise(result) && (result = observableFromPromise(result));
|
3002
|
+
(Array.isArray(result) || isIterable(result)) && (result = observableFrom(result));
|
3003
|
+
return result;
|
3004
|
+
}).mergeObservable();
|
3005
|
+
}
|
3043
3006
|
|
3044
|
-
|
3045
|
-
|
3046
|
-
|
3047
|
-
|
3048
|
-
|
3049
|
-
|
3050
|
-
|
3051
|
-
|
3052
|
-
|
3053
|
-
|
3054
|
-
|
3055
|
-
|
3056
|
-
|
3057
|
-
|
3058
|
-
|
3059
|
-
|
3060
|
-
|
3061
|
-
|
3062
|
-
|
3063
|
-
|
3064
|
-
|
3065
|
-
|
3066
|
-
|
3067
|
-
|
3068
|
-
|
3069
|
-
|
3070
|
-
|
3071
|
-
|
3072
|
-
|
3073
|
-
|
3074
|
-
|
3075
|
-
|
3076
|
-
|
3077
|
-
|
3078
|
-
|
3007
|
+
/**
|
3008
|
+
* One of the Following:
|
3009
|
+
* Projects each element of an observable sequence to an observable sequence and merges the resulting observable sequences into one observable sequence.
|
3010
|
+
*
|
3011
|
+
* @example
|
3012
|
+
* var res = source.selectMany(function (x) { return Rx.Observable.range(0, x); });
|
3013
|
+
* Or:
|
3014
|
+
* Projects each element of an observable sequence to an observable sequence, invokes the result selector for the source element and each of the corresponding inner sequence's elements, and merges the results into one observable sequence.
|
3015
|
+
*
|
3016
|
+
* var res = source.selectMany(function (x) { return Rx.Observable.range(0, x); }, function (x, y) { return x + y; });
|
3017
|
+
* Or:
|
3018
|
+
* Projects each element of the source observable sequence to the other observable sequence and merges the resulting observable sequences into one observable sequence.
|
3019
|
+
*
|
3020
|
+
* var res = source.selectMany(Rx.Observable.fromArray([1,2,3]));
|
3021
|
+
* @param {Function} selector A transform function to apply to each element or an observable sequence to project each element from the source sequence onto which could be either an observable or Promise.
|
3022
|
+
* @param {Function} [resultSelector] A transform function to apply to each element of the intermediate sequence.
|
3023
|
+
* @param {Any} [thisArg] Object to use as this when executing callback.
|
3024
|
+
* @returns {Observable} An observable sequence whose elements are the result of invoking the one-to-many transform function collectionSelector on each element of the input sequence and then mapping each of those sequence elements and their corresponding source element to a result element.
|
3025
|
+
*/
|
3026
|
+
observableProto.selectMany = observableProto.flatMap = function (selector, resultSelector, thisArg) {
|
3027
|
+
if (typeof selector === 'function' && typeof resultSelector === 'function') {
|
3028
|
+
return this.flatMap(function (x, i) {
|
3029
|
+
var selectorResult = selector(x, i);
|
3030
|
+
isPromise(selectorResult) && (selectorResult = observableFromPromise(selectorResult));
|
3031
|
+
(Array.isArray(selectorResult) || isIterable(selectorResult)) && (selectorResult = observableFrom(selectorResult));
|
3032
|
+
|
3033
|
+
return selectorResult.map(function (y, i2) {
|
3034
|
+
return resultSelector(x, y, i, i2);
|
3035
|
+
});
|
3036
|
+
}, thisArg);
|
3037
|
+
}
|
3038
|
+
return typeof selector === 'function' ?
|
3039
|
+
flatMap(this, selector, thisArg) :
|
3040
|
+
flatMap(this, function () { return selector; });
|
3041
|
+
};
|
3079
3042
|
|
3080
3043
|
/**
|
3081
3044
|
* Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then
|
@@ -3985,7 +3948,7 @@
|
|
3985
3948
|
* @returns {Observable} The source sequence switching to the other sequence in case of a timeout.
|
3986
3949
|
*/
|
3987
3950
|
observableProto.timeout = function (dueTime, other, scheduler) {
|
3988
|
-
other || (other = observableThrow(new Error('Timeout')));
|
3951
|
+
(other == null || typeof other === 'string') && (other = observableThrow(new Error(other || 'Timeout')));
|
3989
3952
|
isScheduler(scheduler) || (scheduler = timeoutScheduler);
|
3990
3953
|
|
3991
3954
|
var source = this, schedulerMethod = dueTime instanceof Date ?
|
@@ -4389,115 +4352,41 @@
|
|
4389
4352
|
return ControlledSubject;
|
4390
4353
|
}(Observable));
|
4391
4354
|
|
4392
|
-
|
4393
|
-
*
|
4394
|
-
*
|
4395
|
-
* @returns {Observable}
|
4355
|
+
/**
|
4356
|
+
* Executes a transducer to transform the observable sequence
|
4357
|
+
* @param {Transducer} transducer A transducer to execute
|
4358
|
+
* @returns {Observable} An Observable sequence containing the results from the transducer.
|
4396
4359
|
*/
|
4397
|
-
observableProto.
|
4398
|
-
var
|
4399
|
-
return new AnonymousObservable(function (observer) {
|
4400
|
-
var hasCurrent = false,
|
4401
|
-
isStopped = false,
|
4402
|
-
m = new SingleAssignmentDisposable(),
|
4403
|
-
g = new CompositeDisposable();
|
4404
|
-
|
4405
|
-
g.add(m);
|
4406
|
-
|
4407
|
-
m.setDisposable(sources.subscribe(
|
4408
|
-
function (innerSource) {
|
4409
|
-
if (!hasCurrent) {
|
4410
|
-
hasCurrent = true;
|
4411
|
-
|
4412
|
-
isPromise(innerSource) && (innerSource = observableFromPromise(innerSource));
|
4413
|
-
|
4414
|
-
var innerSubscription = new SingleAssignmentDisposable();
|
4415
|
-
g.add(innerSubscription);
|
4360
|
+
observableProto.transduce = function(transducer) {
|
4361
|
+
var source = this;
|
4416
4362
|
|
4417
|
-
|
4418
|
-
|
4419
|
-
|
4420
|
-
|
4421
|
-
g.remove(innerSubscription);
|
4422
|
-
hasCurrent = false;
|
4423
|
-
if (isStopped && g.length === 1) {
|
4424
|
-
observer.onCompleted();
|
4425
|
-
}
|
4426
|
-
}));
|
4427
|
-
}
|
4363
|
+
function transformForObserver(observer) {
|
4364
|
+
return {
|
4365
|
+
init: function() {
|
4366
|
+
return observer;
|
4428
4367
|
},
|
4429
|
-
|
4430
|
-
|
4431
|
-
isStopped = true;
|
4432
|
-
if (!hasCurrent && g.length === 1) {
|
4433
|
-
observer.onCompleted();
|
4434
|
-
}
|
4435
|
-
}));
|
4436
|
-
|
4437
|
-
return g;
|
4438
|
-
});
|
4439
|
-
};
|
4440
|
-
|
4441
|
-
/*
|
4442
|
-
* Performs a exclusive map waiting for the first to finish before subscribing to another observable.
|
4443
|
-
* Observables that come in between subscriptions will be dropped on the floor.
|
4444
|
-
* @param {Function} selector Selector to invoke for every item in the current subscription.
|
4445
|
-
* @param {Any} [thisArg] An optional context to invoke with the selector parameter.
|
4446
|
-
* @returns {Observable} An exclusive observable with only the results that happen when subscribed.
|
4447
|
-
*/
|
4448
|
-
observableProto.exclusiveMap = function (selector, thisArg) {
|
4449
|
-
var sources = this;
|
4450
|
-
return new AnonymousObservable(function (observer) {
|
4451
|
-
var index = 0,
|
4452
|
-
hasCurrent = false,
|
4453
|
-
isStopped = true,
|
4454
|
-
m = new SingleAssignmentDisposable(),
|
4455
|
-
g = new CompositeDisposable();
|
4456
|
-
|
4457
|
-
g.add(m);
|
4458
|
-
|
4459
|
-
m.setDisposable(sources.subscribe(
|
4460
|
-
function (innerSource) {
|
4461
|
-
|
4462
|
-
if (!hasCurrent) {
|
4463
|
-
hasCurrent = true;
|
4464
|
-
|
4465
|
-
innerSubscription = new SingleAssignmentDisposable();
|
4466
|
-
g.add(innerSubscription);
|
4467
|
-
|
4468
|
-
isPromise(innerSource) && (innerSource = observableFromPromise(innerSource));
|
4469
|
-
|
4470
|
-
innerSubscription.setDisposable(innerSource.subscribe(
|
4471
|
-
function (x) {
|
4472
|
-
var result;
|
4473
|
-
try {
|
4474
|
-
result = selector.call(thisArg, x, index++, innerSource);
|
4475
|
-
} catch (e) {
|
4476
|
-
observer.onError(e);
|
4477
|
-
return;
|
4478
|
-
}
|
4479
|
-
|
4480
|
-
observer.onNext(result);
|
4481
|
-
},
|
4482
|
-
observer.onError.bind(observer),
|
4483
|
-
function () {
|
4484
|
-
g.remove(innerSubscription);
|
4485
|
-
hasCurrent = false;
|
4486
|
-
|
4487
|
-
if (isStopped && g.length === 1) {
|
4488
|
-
observer.onCompleted();
|
4489
|
-
}
|
4490
|
-
}));
|
4491
|
-
}
|
4368
|
+
step: function(obs, input) {
|
4369
|
+
return obs.onNext(input);
|
4492
4370
|
},
|
4493
|
-
|
4494
|
-
|
4495
|
-
|
4496
|
-
|
4497
|
-
|
4371
|
+
result: function(obs) {
|
4372
|
+
return obs.onCompleted();
|
4373
|
+
}
|
4374
|
+
};
|
4375
|
+
}
|
4376
|
+
|
4377
|
+
return new AnonymousObservable(function(observer) {
|
4378
|
+
var xform = transducer(transformForObserver(observer));
|
4379
|
+
return source.subscribe(
|
4380
|
+
function(v) {
|
4381
|
+
try {
|
4382
|
+
xform.step(observer, v);
|
4383
|
+
} catch (e) {
|
4384
|
+
observer.onError(e);
|
4498
4385
|
}
|
4499
|
-
}
|
4500
|
-
|
4386
|
+
},
|
4387
|
+
observer.onError.bind(observer),
|
4388
|
+
function() { xform.result(observer); }
|
4389
|
+
);
|
4501
4390
|
});
|
4502
4391
|
};
|
4503
4392
|
|