Skip to content

Commit 721f207

Browse files
committed
Replace Rx.Observable.fromArray with Rx.Observable.from in Document
1 parent d53a791 commit 721f207

19 files changed

+29
-29
lines changed

doc/api/core/notification.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Creates an object that represents an OnCompleted notification to an observer.
3030
#### Example
3131
```js
3232
var source = Rx.Observable
33-
.fromArray([
33+
.from([
3434
Rx.Notification.createOnCompleted()
3535
])
3636
.dematerialize();
@@ -69,7 +69,7 @@ Creates an object that represents an OnError notification to an observer.
6969
#### Example
7070
```js
7171
var source = Rx.Observable
72-
.fromArray([
72+
.from([
7373
Rx.Notification.createOnError(new Error('woops'))
7474
])
7575
.dematerialize();
@@ -108,7 +108,7 @@ Creates an object that represents an OnNext notification to an observer.
108108
#### Example
109109
```js
110110
var source = Rx.Observable
111-
.fromArray([
111+
.from([
112112
Rx.Notification.createOnNext(42),
113113
Rx.Notification.createOnCompleted()
114114
])

doc/api/core/operators/average.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ var arr = [
3535
{ value: 3 }
3636
];
3737

38-
var source = Rx.Observable.fromArray(arr).average(function (x) {
38+
var source = Rx.Observable.from(arr).average(function (x) {
3939
return x.value;
4040
});
4141

doc/api/core/operators/dematerialize.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Dematerializes the explicit notification values of an observable sequence as imp
99
#### Example
1010
```js
1111
var source = Rx.Observable
12-
.fromArray([
12+
.from([
1313
Rx.Notification.createOnNext(42),
1414
Rx.Notification.createOnError(new Error('woops'))
1515
])

doc/api/core/operators/distinct.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Returns an observable sequence that contains only distinct elements according to
1313
#### Example
1414
```js
1515
/* Without key selector */
16-
var source = Rx.Observable.fromArray([
16+
var source = Rx.Observable.from([
1717
42, 24, 42, 24
1818
])
1919
.distinct();
@@ -34,7 +34,7 @@ var subscription = source.subscribe(
3434
// => Completed
3535

3636
/* With key selector */
37-
var source = Rx.Observable.fromArray([
37+
var source = Rx.Observable.from([
3838
{value: 42}, {value: 24}, {value: 42}, {value: 24}
3939
])
4040
.distinct(function (x) { return x.value; });

doc/api/core/operators/distinctuntilchanged.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Returns an observable sequence that contains only distinct contiguous elements a
1313
#### Example
1414
```js
1515
/* Without key selector */
16-
var source = Rx.Observable.fromArray([
16+
var source = Rx.Observable.from([
1717
42, 42, 24, 24
1818
])
1919
.distinctUntilChanged();
@@ -34,7 +34,7 @@ var subscription = source.subscribe(
3434
// => Completed
3535

3636
/* With key selector */
37-
var source = Rx.Observable.fromArray([
37+
var source = Rx.Observable.from([
3838
{value: 42}, {value: 42}, {value: 24}, {value: 24}
3939
])
4040
.distinctUntilChanged(function (x) { return x.value; });

doc/api/core/operators/elementat.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Returns the element at a specified index in a sequence.
1212
#### Example
1313
```js
1414
/* Finds an index */
15-
var source = Rx.Observable.fromArray([1,2,3,4])
15+
var source = Rx.Observable.from([1,2,3,4])
1616
.elementAt(1);
1717

1818
var subscription = source.subscribe(
@@ -30,7 +30,7 @@ var subscription = source.subscribe(
3030
// => Completed
3131

3232
/* Not found */
33-
var source = Rx.Observable.fromArray([1,2,3,4])
33+
var source = Rx.Observable.from([1,2,3,4])
3434
.elementAt(4);
3535

3636
var subscription = source.subscribe(

doc/api/core/operators/elementatordefault.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Returns the element at a specified index in a sequence.
1313
#### Example
1414
```js
1515
/* Finds an index */
16-
var source = Rx.Observable.fromArray([1,2,3,4])
16+
var source = Rx.Observable.from([1,2,3,4])
1717
.elementAt(1);
1818

1919
var subscription = source.subscribe(
@@ -31,7 +31,7 @@ var subscription = source.subscribe(
3131
// => Completed
3232

3333
/* Not found */
34-
var source = Rx.Observable.fromArray([1,2,3,4])
34+
var source = Rx.Observable.from([1,2,3,4])
3535
.elementAt(4, 0);
3636

3737
var subscription = source.subscribe(

doc/api/core/operators/find.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Searches for an element that matches the conditions defined by the specified pre
1717
/* Found an element */
1818
var array = [1,2,3,4];
1919

20-
var source = Rx.Observable.fromArray(array)
20+
var source = Rx.Observable.from(array)
2121
.find(function (x, i, obs) {
2222
return x === 1;
2323
});
@@ -39,7 +39,7 @@ var subscription = source.subscribe(
3939
/* Not found */
4040
var array = [1,2,3,4];
4141

42-
var source = Rx.Observable.fromArray(array)
42+
var source = Rx.Observable.from(array)
4343
.find(function (x, i, obs) {
4444
return x === 5;
4545
});

doc/api/core/operators/findindex.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Searches for an element that matches the conditions defined by the specified pre
1818
/* Found an element */
1919
var array = [1,2,3,4];
2020

21-
var source = Rx.Observable.fromArray(array)
21+
var source = Rx.Observable.from(array)
2222
.findIndex(function (x, i, obs) {
2323
return x === 1;
2424
});
@@ -40,7 +40,7 @@ var subscription = source.subscribe(
4040
/* Not found */
4141
var array = [1,2,3,4];
4242

43-
var source = Rx.Observable.fromArray(array)
43+
var source = Rx.Observable.from(array)
4444
.findIndex(function (x, i, obs) {
4545
return x === 5;
4646
});

doc/api/core/operators/forkjoin.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Runs all observable sequences in parallel and collect their last elements.
1515
var source = Rx.Observable.forkJoin(
1616
Rx.Observable.return(42),
1717
Rx.Observable.range(0, 10),
18-
Rx.Observable.fromArray([1,2,3]),
18+
Rx.Observable.from([1,2,3]),
1919
RSVP.Promise.resolve(56)
2020
);
2121

doc/api/core/operators/groupby.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ var codes = [
2626
{ keyCode: 65} // a
2727
];
2828

29-
var source = Rx.Observable.fromArray(codes)
29+
var source = Rx.Observable.from(codes)
3030
.groupBy(
3131
function (x) { return x.keyCode; },
3232
function (x) { return x.keyCode; });

doc/api/core/operators/max.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Returns the maximum value in an observable sequence according to the specified c
1212
#### Example
1313
```js
1414
/* Without comparer */
15-
var source = Rx.Observable.fromArray([1,3,5,7,9,2,4,6,8])
15+
var source = Rx.Observable.from([1,3,5,7,9,2,4,6,8])
1616
.max();
1717

1818
var subscription = source.subscribe(
@@ -39,7 +39,7 @@ function comparer (x, y) {
3939
return 0;
4040
}
4141

42-
var source = Rx.Observable.fromArray([1,3,5,7,9,2,4,6,8])
42+
var source = Rx.Observable.from([1,3,5,7,9,2,4,6,8])
4343
.max(comparer);
4444

4545
var subscription = source.subscribe(

doc/api/core/operators/maxby.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Returns the maximum value in an observable sequence according to the specified c
1313
#### Example
1414
```js
1515
/* Without comparer */
16-
var source = Rx.Observable.fromArray([1,3,5,7,9,2,4,6,8,9])
16+
var source = Rx.Observable.from([1,3,5,7,9,2,4,6,8,9])
1717
.maxBy(function (x) { return x; });
1818

1919
var subscription = source.subscribe(

doc/api/core/operators/min.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Returns the minimum element in an observable sequence according to the optional
1212
#### Example
1313
```js
1414
/* Without comparer */
15-
var source = Rx.Observable.fromArray([1,3,5,7,9,2,4,6,8])
15+
var source = Rx.Observable.from([1,3,5,7,9,2,4,6,8])
1616
.min();
1717

1818
var subscription = source.subscribe(
@@ -39,7 +39,7 @@ function comparer (x, y) {
3939
return 0;
4040
}
4141

42-
var source = Rx.Observable.fromArray([1,3,5,7,9,2,4,6,8])
42+
var source = Rx.Observable.from([1,3,5,7,9,2,4,6,8])
4343
.min(comparer);
4444

4545
var subscription = source.subscribe(

doc/api/core/operators/minby.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Returns the elements in an observable sequence with the minimum key value accord
1313
#### Example
1414
```js
1515
/* Without comparer */
16-
var source = Rx.Observable.fromArray([1,3,5,7,9,2,4,6,8,1])
16+
var source = Rx.Observable.from([1,3,5,7,9,2,4,6,8,1])
1717
.minBy(function (x) { return x; });
1818

1919
var subscription = source.subscribe(

doc/api/core/operators/pluck.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Projects each element of an observable sequence into a new form by incorporating
1212
#### Example
1313
```js
1414
var source = Rx.Observable
15-
.fromArray([
15+
.from([
1616
{ value: 0 },
1717
{ value: 1 },
1818
{ value: 2 }

doc/api/core/operators/sum.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ var array = [
4040
];
4141

4242
var source = Rx.Observable
43-
.fromArray(array)
43+
.from(array)
4444
.sum(function (x, idx, obs) {
4545
return x.value;
4646
});

doc/gettingstarted/querying.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ In the following example, we project a sequence of strings into an a series of i
8282
```js
8383
var array = ['Reactive', 'Extensions', 'RxJS'];
8484

85-
var seqString = Rx.Observable.fromArray(array);
85+
var seqString = Rx.Observable.from(array);
8686

8787
var seqNum = seqString.map(function (x) { return x.length; });
8888

doc/mapping/async/comparing.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ var Rx = require('rx'),
269269
fs = require('fs');
270270

271271
Rx.Observable
272-
.fromArray([1,2,3], Rx.Scheduler.timeout)
272+
.from([1,2,3], Rx.Scheduler.timeout)
273273
.reduce(function (acc, x) { return acc + x; }, 0)
274274
.forEach( function (results) { console.log(results); });
275275
// => 6

0 commit comments

Comments
 (0)