Skip to content
This repository was archived by the owner on Apr 20, 2018. It is now read-only.

Commit a17eef2

Browse files
Merge pull request #12 from douglasduteil/patch-1
Update nodejs.md
2 parents 7cfb102 + 0d4dd94 commit a17eef2

File tree

1 file changed

+0
-158
lines changed

1 file changed

+0
-158
lines changed

doc/api/nodejs.md

Lines changed: 0 additions & 158 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,8 @@ The Reactive Extensions for JavaScript provides integration points to the core N
66

77
## `RxNode Methods`
88

9-
### Callback Handlers
10-
11-
- [`fromCallback`](#rxnodefromcallbackfunc-scheduler-context)
12-
- [`fromNodeCallback`](#rxnodefromnodecallbackfunc-scheduler-context)
13-
149
### Event Handlers
1510

16-
- [`fromEvent`](#rxnodefromeventeventemitter-eventname)
1711
- [`toEventEmitter`](#rxnodetoeventemitterobservable-eventname-handler)
1812

1913
### Stream Handlers
@@ -27,158 +21,6 @@ The Reactive Extensions for JavaScript provides integration points to the core N
2721

2822
## _RxNode Methods_ ##
2923

30-
### Callback Handlers ###
31-
32-
### <a id="rxnodefromcallbackfunc-scheduler-context"></a>`RxNode.fromCallback(func, [scheduler], [context])`
33-
<a href="#rxnodefromcallbackfunc-scheduler-context">#</a> [&#x24C8;](https://github.com/Reactive-Extensions/RxJS/blob/master/index.js#L20-L22 "View in source")
34-
35-
**Deprecated in favor of `Rx.Observable.fromCallback` in rx.async.js.**
36-
37-
Converts a callback function to an observable sequence.
38-
39-
#### Arguments
40-
1. `func` *(Function)*: Callback function
41-
2. `[scheduler = Rx.Scheduler.timeout]` *(Scheduler)*: Scheduler used to execute the callback.
42-
3. `[context]` *(Any)*: The context to execute the callback.
43-
44-
#### Returns
45-
*(Function)*: Function, when called with arguments, creates an Observable sequence from the callback.
46-
47-
#### Example
48-
```js
49-
var fs = require('fs');
50-
var Rx = require('rx');
51-
var RxNode = require('rx-node');
52-
53-
// Wrap exists
54-
var exists = RxNode.fromCallback(fs.exists);
55-
56-
// Call exists
57-
var source = exists('/etc/passwd');
58-
59-
var observer = Rx.Observer.create(
60-
function (x) {
61-
console.log('Next: ' + x);
62-
},
63-
function (err) {
64-
console.log('Error: ' + err);
65-
},
66-
function () {
67-
console.log('Completed');
68-
}
69-
);
70-
71-
var subscription = source.subscribe(observer);
72-
73-
// => Next: true
74-
// => Completed
75-
```
76-
77-
### Location
78-
79-
- index.js
80-
81-
* * *
82-
83-
### <a id="rxnodefromnodecallbackfunc-scheduler-context"></a>`RxNode.fromNodeCallback(func, [scheduler], [context])`
84-
<a href="#rxnodefromcallbackfunc-scheduler-context">#</a> [&#x24C8;](https://github.com/Reactive-Extensions/RxJS/blob/master/index.js#L34-L36 "View in source")
85-
86-
**Deprecated in favor of `Rx.Observable.fromNodeCallback` in rx.async.js.**
87-
88-
Converts a Node.js callback style function to an observable sequence. This must be in function (err, ...) format.
89-
90-
#### Arguments
91-
1. `func` *(Function)*: Callback function which must be in function (err, ...) format.
92-
2. `[scheduler = Rx.Scheduler.timeout]` *(Scheduler)*: Scheduler used to execute the callback.
93-
3. `[context]` *(Any)*: The context to execute the callback.
94-
95-
#### Returns
96-
*(Function)*: An function which when applied, returns an observable sequence with the callback arguments as an array.
97-
98-
#### Example
99-
```js
100-
var fs = require('fs');
101-
var Rx = require('rx');
102-
var RxNode = require('rx-node');
103-
104-
var source = RxNode.fromNodeCallback(fs.stat)('file.txt');
105-
106-
var observer = Rx.Observer.create(
107-
function (x) {
108-
var stat = x[0];
109-
console.log('Next: ' + stat.isFile());
110-
},
111-
function (err) {
112-
console.log('Error: ' + err);
113-
},
114-
function () {
115-
console.log('Completed');
116-
}
117-
);
118-
119-
var subscription = source.subscribe(observer);
120-
121-
// => Next: true
122-
// => Completed
123-
```
124-
125-
### Location
126-
127-
- index.js
128-
129-
* * *
130-
131-
### Event Handlers ###
132-
133-
### <a id="rxnodefromeventeventemitter-eventname"></a>`RxNode.fromEvent(eventEmitter, eventName)`
134-
<a href="#rxnodefromeventeventemitter-eventname">#</a> [&#x24C8;](https://github.com/Reactive-Extensions/RxJS/blob/master/index.js#L48-L50 "View in source")
135-
136-
**Deprecated in favor of `Rx.Observable.fromEvent` in rx.async.js.**
137-
138-
Handles an event from the given EventEmitter as an observable sequence.
139-
140-
#### Arguments
141-
1. `eventEmitter` *(EventEmitter)*: The EventEmitter to subscribe to the given event.
142-
2. `eventName` *(String)*: The event name to subscribe.
143-
144-
#### Returns
145-
*(Observable)*: An observable sequence generated from the named event from the given EventEmitter.
146-
147-
#### Example
148-
```js
149-
var EventEmitter = require('events').EventEmitter;
150-
var Rx = require('rx');
151-
var RxNode = require('rx-node');
152-
153-
var emitter = new EventEmitter();
154-
155-
var source = RxNode.fromEvent(emitter, 'data');
156-
157-
var observer = Rx.Observer.create(
158-
function (x) {
159-
console.log('Next: ' + x[0]);
160-
},
161-
function (err) {
162-
console.log('Error: ' + err);
163-
},
164-
function () {
165-
console.log('Completed');
166-
}
167-
);
168-
169-
var subscription = source.subscribe(observer);
170-
171-
emitter.emit('data', 'foo');
172-
173-
// => Next: foo
174-
```
175-
176-
### Location
177-
178-
- index.js
179-
180-
* * *
181-
18224
### <a id="rxnodetoeventemitterobservable-eventname"></a>`RxNode.toEventEmitter(observable, eventName)`
18325
<a href="#rxnodetoeventemitterobservable-eventname">#</a> [&#x24C8;](https://github.com/Reactive-Extensions/RxJS/blob/master/index.js#L60-L88 "View in source")
18426

0 commit comments

Comments
 (0)