rxjs-rails 2.2.27 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
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;
|
49
|
+
|
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
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
};
|
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();
|
89
|
+
|
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
|
+
};
|
104
|
+
|
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);
|
116
|
+
|
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
|
+
}
|
128
|
+
|
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
|
+
}
|
103
140
|
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
* @param {Function} function Function with a callback as the last parameter to convert to an Observable sequence.
|
108
|
-
* @param {Scheduler} [scheduler] Scheduler to run the function on. If not specified, defaults to Scheduler.timeout.
|
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, scheduler, context, selector) {
|
114
|
-
scheduler || (scheduler = immediateScheduler);
|
115
|
-
return function () {
|
116
|
-
var args = slice.call(arguments, 0);
|
117
|
-
|
118
|
-
return new AnonymousObservable(function (observer) {
|
119
|
-
return scheduler.schedule(function () {
|
120
|
-
function handler(e) {
|
121
|
-
var results = e;
|
122
|
-
|
123
|
-
if (selector) {
|
124
|
-
try {
|
125
|
-
results = selector(arguments);
|
126
|
-
} catch (err) {
|
127
|
-
observer.onError(err);
|
128
|
-
return;
|
129
|
-
}
|
130
|
-
} else {
|
131
|
-
if (results.length === 1) {
|
132
|
-
results = results[0];
|
133
|
-
}
|
134
|
-
}
|
135
|
-
|
136
|
-
observer.onNext(results);
|
137
|
-
observer.onCompleted();
|
138
|
-
}
|
139
|
-
|
140
|
-
args.push(handler);
|
141
|
-
func.apply(context, args);
|
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
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
func.apply(context, args);
|
190
|
-
});
|
191
|
-
});
|
192
|
-
};
|
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);
|
157
|
+
|
158
|
+
return new AnonymousObservable(function (observer) {
|
159
|
+
function handler(err) {
|
160
|
+
if (err) {
|
161
|
+
observer.onError(err);
|
162
|
+
return;
|
163
|
+
}
|
164
|
+
|
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
|
+
}
|
182
|
+
|
183
|
+
observer.onCompleted();
|
184
|
+
}
|
185
|
+
|
186
|
+
args.push(handler);
|
187
|
+
func.apply(context, args);
|
188
|
+
});
|
193
189
|
};
|
190
|
+
};
|
194
191
|
|
195
192
|
function fixEvent(event) {
|
196
193
|
var stopPropagation = function () {
|
@@ -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(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 e(a,b,c){if(a.addListener)return a.addListener(b,c),l(function(){a.removeListener(b,c)});if(a.addEventListener)return a.addEventListener(b,c,!1),l(function(){a.removeEventListener(b,c,!1)});if(a.attachEvent){var e=function(a){c(d(a))};return a.attachEvent("on"+b,e),l(function(){a.detachEvent("on"+b,e)})}return a["on"+b]=c,l(function(){a["on"+b]=null})}function f(a,b,c){var d=new m;if("function"==typeof a.item&&"number"==typeof a.length)for(var g=0,h=a.length;h>g;g++)d.add(f(a.item(g),b,c));else a&&d.add(e(a,b,c));return d}var g=c.Observable,h=(g.prototype,g.fromPromise),i=g.throwException,j=c.AnonymousObservable,k=c.AsyncSubject,l=c.Disposable.create,m=c.CompositeDisposable,n=(c.Scheduler.immediate,c.Scheduler.timeout),o=c.helpers.isScheduler,p=Array.prototype.slice;g.start=function(a,b,c){return q(a,b,c)()};var q=g.toAsync=function(a,b,c){return o(c)||(c=n),function(){var d=arguments,e=new k;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()}};g.fromCallback=function(a,b,c){return function(){var d=p.call(arguments,0);return new j(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)})}},g.fromNodeCallback=function(a,b,c){return function(){var d=p.call(arguments,0);return new j(function(e){function f(a){if(a)return void e.onError(a);var b=p.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 r=a.angular&&angular.element?angular.element:a.jQuery?a.jQuery:a.Zepto?a.Zepto:null,s=!!a.Ember&&"function"==typeof a.Ember.addListener;g.fromEvent=function(a,b,c){if(s)return t(function(c){Ember.addListener(a,b,c)},function(c){Ember.removeListener(a,b,c)},c);if(r){var d=r(a);return t(function(a){d.on(b,a)},function(a){d.off(b,a)},c)}return new j(function(d){return f(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 t=g.fromEventPattern=function(a,b,c){return new j(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 l(function(){b&&b(e,f)})}).publish().refCount()};return g.startAsync=function(a){var b;try{b=a()}catch(c){return i(c)}return h(b)},c});
|