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

Commit bb10b50

Browse files
Merge pull request #511 from 38elements/master
Update document
2 parents ece119c + 741cbea commit bb10b50

4 files changed

Lines changed: 64 additions & 3 deletions

File tree

doc/api/core/operators/and.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,4 @@ NuGet Packages:
5454
- [`RxJS-JoinPatterns`](http://www.nuget.org/packages/RxJS-JoinPatterns)
5555

5656
Unit Tests:
57-
- [/tests/observable/and.js](https://github.com/Reactive-Extensions/RxJS/blob/master/tests/observable/and.js)
57+
- [/tests/observable/when.js](https://github.com/Reactive-Extensions/RxJS/blob/master/tests/observable/when.js)

doc/api/core/operators/thendo.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
### `Rx.Observable.prototype.thenDo(selector)`
2+
[Ⓢ](https://github.com/Reactive-Extensions/RxJS/blob/master/src/core/linq/observable/thendo.js "View in source")
3+
4+
Matches when the observable sequence has an available value and projects the value.
5+
6+
#### Arguments
7+
1. `selector` *(`Function`)*: Selector that will be invoked for values in the source sequence.
8+
9+
#### Returns
10+
*(`Plan`)*: Plan that produces the projected values, to be fed (with other plans) to the when operator.
11+
12+
#### Example
13+
```js
14+
var selector = function (x, y) { return x + ", " + y; };
15+
16+
var source = Rx.Observable.when(
17+
Rx.Observable.interval(250).and(Rx.Observable.of("A", "B", "C")).thenDo(selector),
18+
Rx.Observable.interval(300).and(Rx.Observable.of("a", "b")).thenDo(selector)
19+
);
20+
21+
var subscription = source.subscribe(
22+
function (x) {
23+
console.log('Next: ' + x);
24+
},
25+
function (err) {
26+
console.log('Error: ' + err);
27+
},
28+
function () {
29+
console.log('Completed');
30+
});
31+
32+
// => Next: 0, A
33+
// => Next: 0, a
34+
// => Next: 1, B
35+
// => Next: 1, b
36+
// => Next: 2, C
37+
// => Completed
38+
```
39+
40+
### Location
41+
42+
File:
43+
- [/src/core/linq/observable/thendo.js](https://github.com/Reactive-Extensions/RxJS/blob/master/src/core/linq/observable/thendo.js)
44+
45+
Dist:
46+
- [`rx.all.js`](https://github.com/Reactive-Extensions/RxJS/blob/master/dist/rx.all.js)
47+
- [`rx.all.compat.js`](https://github.com/Reactive-Extensions/RxJS/blob/master/dist/rx.all.compat.js)
48+
- [`rx.joinpatterns.js`](https://github.com/Reactive-Extensions/RxJS/blob/master/dist/rx.joinpatterns.js)
49+
50+
Prerequisites:
51+
- [`rx.js`](https://github.com/Reactive-Extensions/RxJS/blob/master/dist/rx.js) | [`rx.compat.js`](https://github.com/Reactive-Extensions/RxJS/blob/master/dist/rx.compat.js) | [`rx.lite.js`](https://github.com/Reactive-Extensions/RxJS/blob/master/dist/rx.lite.js) | [`rx.lite.compat.js`](https://github.com/Reactive-Extensions/RxJS/blob/master/dist/rx.lite.compat.js)
52+
53+
NPM Packages:
54+
- [`rx`](https://www.npmjs.org/package/rx)
55+
56+
NuGet Packages:
57+
- [`RxJS-All`](http://www.nuget.org/packages/RxJS-All)
58+
- [`RxJS-JoinPatterns`](http://www.nuget.org/packages/RxJS-JoinPatterns)
59+
60+
Unit Tests:
61+
- [/tests/observable/when.js](https://github.com/Reactive-Extensions/RxJS/blob/master/tests/observable/when.js)

doc/libraries/rx.joinpatterns.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@ NuGet Dependencies:
3030
- [`and`](../api/core/operators/and.md)
3131

3232
### `Pattern Instance Methods`
33-
- [`then`](../api/core/operators/thendo.md)
33+
- [`thenDo`](../api/core/operators/thendo.md)

src/core/linq/observable/thendo.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* Matches when the observable sequence has an available value and projects the value.
33
*
4-
* @param selector Selector that will be invoked for values in the source sequence.
4+
* @param {Function} selector Selector that will be invoked for values in the source sequence.
55
* @returns {Plan} Plan that produces the projected values, to be fed (with other plans) to the when operator.
66
*/
77
observableProto.thenDo = function (selector) {

0 commit comments

Comments
 (0)