rxjs-rails 2.2.19 → 2.2.20
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 +2 -2
- data/lib/rxjs/rails/version.rb +1 -1
- data/vendor/assets/javascripts/rx.aggregates.js +126 -121
- data/vendor/assets/javascripts/rx.aggregates.min.js +1 -1
- data/vendor/assets/javascripts/rx.async.compat.js +2 -1
- data/vendor/assets/javascripts/rx.async.compat.min.js +1 -1
- data/vendor/assets/javascripts/rx.async.js +2 -1
- data/vendor/assets/javascripts/rx.async.min.js +1 -1
- data/vendor/assets/javascripts/rx.compat.js +470 -464
- data/vendor/assets/javascripts/rx.compat.min.js +2 -2
- data/vendor/assets/javascripts/rx.experimental.js +202 -191
- data/vendor/assets/javascripts/rx.experimental.min.js +1 -1
- data/vendor/assets/javascripts/rx.js +470 -464
- data/vendor/assets/javascripts/rx.lite.compat.js +352 -348
- data/vendor/assets/javascripts/rx.lite.compat.min.js +2 -2
- data/vendor/assets/javascripts/rx.lite.js +352 -348
- data/vendor/assets/javascripts/rx.lite.min.js +2 -2
- data/vendor/assets/javascripts/rx.min.js +2 -2
- data/vendor/assets/javascripts/rx.node.js +113 -115
- data/version.rb.m4 +6 -0
- metadata +3 -2
@@ -12,133 +12,131 @@ require('./rx.testing');
|
|
12
12
|
|
13
13
|
// Add specific Node functions
|
14
14
|
var EventEmitter = require('events').EventEmitter,
|
15
|
-
|
15
|
+
Observable = Rx.Observable;
|
16
16
|
|
17
17
|
Rx.Node = {
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
18
|
+
/**
|
19
|
+
* @deprecated Use Rx.Observable.fromCallback from rx.async.js instead.
|
20
|
+
*
|
21
|
+
* Converts a callback function to an observable sequence.
|
22
|
+
*
|
23
|
+
* @param {Function} func Function to convert to an asynchronous function.
|
24
|
+
* @param {Scheduler} [scheduler] Scheduler to run the function on. If not specified, defaults to Scheduler.timeout.
|
25
|
+
* @param {Mixed} [context] The context for the func parameter to be executed. If not specified, defaults to undefined.
|
26
|
+
* @param {Function} [selector] A selector which takes the arguments from the event handler to produce a single item to yield on next.
|
27
|
+
* @returns {Function} Asynchronous function.
|
28
|
+
*/
|
29
|
+
fromCallback: function (func, scheduler, context, selector) {
|
30
|
+
return Observable.fromCallback(func, scheduler, context, selector);
|
31
|
+
},
|
32
32
|
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
33
|
+
/**
|
34
|
+
* @deprecated Use Rx.Observable.fromNodeCallback from rx.async.js instead.
|
35
|
+
*
|
36
|
+
* Converts a Node.js callback style function to an observable sequence. This must be in function (err, ...) format.
|
37
|
+
*
|
38
|
+
* @param {Function} func The function to call
|
39
|
+
* @param {Scheduler} [scheduler] Scheduler to run the function on. If not specified, defaults to Scheduler.timeout.
|
40
|
+
* @param {Mixed} [context] The context for the func parameter to be executed. If not specified, defaults to undefined.
|
41
|
+
* @param {Function} [selector] A selector which takes the arguments from the event handler to produce a single item to yield on next.
|
42
|
+
* @returns {Function} An async function which when applied, returns an observable sequence with the callback arguments as an array.
|
43
|
+
*/
|
44
|
+
fromNodeCallback: function (func, scheduler, context, selector) {
|
45
|
+
return Observable.fromNodeCallback(func, scheduler, context, selector);
|
46
|
+
},
|
47
47
|
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
48
|
+
/**
|
49
|
+
* @deprecated Use Rx.Observable.fromNodeCallback from rx.async.js instead.
|
50
|
+
*
|
51
|
+
* Handles an event from the given EventEmitter as an observable sequence.
|
52
|
+
*
|
53
|
+
* @param {EventEmitter} eventEmitter The EventEmitter to subscribe to the given event.
|
54
|
+
* @param {String} eventName The event name to subscribe
|
55
|
+
* @param {Function} [selector] A selector which takes the arguments from the event handler to produce a single item to yield on next.
|
56
|
+
* @returns {Observable} An observable sequence generated from the named event from the given EventEmitter. The data will be returned as an array of arguments to the handler.
|
57
|
+
*/
|
58
|
+
fromEvent: function (eventEmitter, eventName, selector) {
|
59
|
+
return Observable.fromEvent(eventEmitter, eventName, selector);
|
60
|
+
},
|
61
61
|
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
62
|
+
/**
|
63
|
+
* Converts the given observable sequence to an event emitter with the given event name.
|
64
|
+
* The errors are handled on the 'error' event and completion on the 'end' event.
|
65
|
+
* @param {Observable} observable The observable sequence to convert to an EventEmitter.
|
66
|
+
* @param {String} eventName The event name to emit onNext calls.
|
67
|
+
* @returns {EventEmitter} An EventEmitter which emits the given eventName for each onNext call in addition to 'error' and 'end' events.
|
68
|
+
* You must call publish in order to invoke the subscription on the Observable sequuence.
|
69
|
+
*/
|
70
|
+
toEventEmitter: function (observable, eventName) {
|
71
|
+
var e = new EventEmitter();
|
72
72
|
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
73
|
+
// Used to publish the events from the observable
|
74
|
+
e.publish = function () {
|
75
|
+
e.subscription = observable.subscribe(
|
76
|
+
function (x) {
|
77
|
+
e.emit(eventName, x);
|
78
|
+
},
|
79
|
+
function (err) {
|
80
|
+
e.emit('error', err);
|
81
|
+
},
|
82
|
+
function () {
|
83
|
+
e.emit('end');
|
84
|
+
});
|
85
|
+
};
|
86
86
|
|
87
|
-
|
88
|
-
|
87
|
+
return e;
|
88
|
+
},
|
89
89
|
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
90
|
+
/**
|
91
|
+
* Converts a flowing stream to an Observable sequence.
|
92
|
+
* @param {Stream} stream A stream to convert to a observable sequence.
|
93
|
+
* @returns {Observable} An observable sequence which fires on each 'data' event as well as handling 'error' and 'end' events.
|
94
|
+
*/
|
95
|
+
fromStream: function (stream) {
|
96
|
+
return Observable.create(function (observer) {
|
97
|
+
function dataHandler (data) {
|
98
|
+
observer.onNext(data);
|
99
|
+
}
|
100
100
|
|
101
|
-
|
102
|
-
|
103
|
-
|
101
|
+
function errorHandler (err) {
|
102
|
+
observer.onError(err);
|
103
|
+
}
|
104
104
|
|
105
|
-
|
106
|
-
|
107
|
-
|
105
|
+
function endHandler () {
|
106
|
+
observer.onCompleted();
|
107
|
+
}
|
108
108
|
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
109
|
+
stream.addListener('data', dataHandler);
|
110
|
+
stream.addListener('error', errorHandler);
|
111
|
+
stream.addListener('end', endHandler);
|
112
|
+
|
113
|
+
return function () {
|
114
|
+
stream.removeListener('data', dataHandler);
|
115
|
+
stream.removeListener('error', errorHandler);
|
116
|
+
stream.removeListener('end', endHandler);
|
117
|
+
};
|
118
|
+
}).publish().refCount();
|
119
|
+
},
|
120
120
|
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
});
|
141
|
-
}
|
121
|
+
/**
|
122
|
+
* Writes an observable sequence to a stream
|
123
|
+
* @param {Observable} observable Observable sequence to write to a stream.
|
124
|
+
* @param {Stream} stream The stream to write to.
|
125
|
+
* @param {String} [encoding] The encoding of the item to write.
|
126
|
+
* @returns {Disposable} The subscription handle.
|
127
|
+
*/
|
128
|
+
writeToStream: function (observable, stream, encoding) {
|
129
|
+
return observable.subscribe(
|
130
|
+
function (x) {
|
131
|
+
stream.write(String(x), encoding);
|
132
|
+
},
|
133
|
+
function (err) {
|
134
|
+
stream.emit('error', err);
|
135
|
+
}, function () {
|
136
|
+
// Hack check because STDIO is not closable
|
137
|
+
!stream._isStdio && stream.end();
|
138
|
+
});
|
139
|
+
}
|
142
140
|
};
|
143
141
|
|
144
142
|
module.exports = Rx;
|
data/version.rb.m4
ADDED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rxjs-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
4
|
+
version: 2.2.20
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- jdeseno
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-04-
|
11
|
+
date: 2014-04-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|
@@ -80,6 +80,7 @@ files:
|
|
80
80
|
- vendor/assets/javascripts/rx.time.min.js
|
81
81
|
- vendor/assets/javascripts/rx.virtualtime.js
|
82
82
|
- vendor/assets/javascripts/rx.virtualtime.min.js
|
83
|
+
- version.rb.m4
|
83
84
|
homepage: http://rubygems.org/gems/rxjs-rails
|
84
85
|
licenses:
|
85
86
|
- MIT
|