forked from Reactive-Extensions/RxJS
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
88b03c8
commit 89ca49c
Showing
17 changed files
with
1,009 additions
and
579 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
### `Rx.Observable.prototype.let(func)` | ||
[Ⓢ](https://github.com/Reactive-Extensions/RxJS/blob/master/src/core/linq/observable/let.js "View in source") | ||
|
||
Returns an observable sequence that is the result of invoking the selector on the source sequence, without sharing subscriptions. | ||
|
||
This operator allows for a fluent style of writing queries that use the same sequence multiple times. There is an alias of `letBind` for browsers older than IE 9. | ||
|
||
#### Arguments | ||
1. `func` *(`Function`)*: Selector function which can use the source sequence as many times as needed, without sharing subscriptions to the source sequence. | ||
|
||
#### Returns | ||
*(`Observable`)*: An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function. | ||
|
||
#### Example | ||
```js | ||
var obs = Rx.Observable.range(1, 3); | ||
|
||
var source = obs.let(function (o) { return o.concat(o); }); | ||
|
||
var subscription = source.subscribe( | ||
function (x) { | ||
console.log('Next: ' + x); | ||
}, | ||
function (err) { | ||
console.log('Error: ' + err); | ||
}, | ||
function () { | ||
console.log('Completed'); | ||
}); | ||
|
||
var subscription = source.subscribe( | ||
function (x) { | ||
console.log('Next: ' + x); | ||
}, | ||
function (err) { | ||
console.log('Error: ' + err); | ||
}, | ||
function () { | ||
console.log('Completed'); | ||
}); | ||
|
||
// => Next: 1 | ||
// => Next: 2 | ||
// => Next: 3 | ||
// => Next: 1 | ||
// => Next: 2 | ||
// => Next: 3 | ||
// => Completed | ||
``` | ||
|
||
### Location | ||
|
||
File: | ||
- [`/src/core/observable/let.js`](https://github.com/Reactive-Extensions/RxJS/blob/master/src/core/linq/observable/let.js) | ||
|
||
Dist: | ||
- [`rx.all.js`](https://github.com/Reactive-Extensions/RxJS/blob/master/rx.all.js) | ||
- [`rx.all.compat.js`](https://github.com/Reactive-Extensions/RxJS/blob/master/rx.all.compat.js) | ||
- [`rx.experimental.js`](https://github.com/Reactive-Extensions/RxJS/blob/master/rx.experimental.js) | ||
|
||
Prerequisites: | ||
- [`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/rx.lite.js) | [`rx.lite.compat.js`](https://github.com/Reactive-Extensions/RxJS/blob/master/rx.lite.compat.js) | ||
|
||
NPM Packages: | ||
- [`rx`](https://www.npmjs.org/package/rx) | ||
|
||
NuGet Packages: | ||
- [`RxJS-All`](http://www.nuget.org/packages/RxJS-All) | ||
- [`RxJS-Experimental`](http://www.nuget.org/packages/RxJS-Experimental) | ||
|
||
Unit Tests: | ||
- [`/tests/observable/let.js`](https://github.com/Reactive-Extensions/RxJS/blob/master/tests/observable/let.js) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
### `Rx.Observable.prototype.manySelect(selector, [scheduler])` | ||
[Ⓢ](https://github.com/Reactive-Extensions/RxJS/blob/master/src/core/linq/observable/manyselect.js "View in source") | ||
|
||
Comonadic bind operator. | ||
|
||
#### Arguments | ||
1. `selector` *(`Function`)*: A transform function to apply to each element. | ||
2. `[scheduler=Rx.Scheduler.immediate]` *(`Scheduler`)*: Scheduler used to execute the operation. If not specified, defaults to the `Rx.Scheduler.immediate` scheduler. | ||
|
||
#### Returns | ||
*(`Observable`)*: An observable sequence which results from the comonadic bind operation. | ||
|
||
#### Example | ||
```js | ||
var source = Rx.Observable.range(0, 3) | ||
.manySelect(function (ys) { return ys.first(); }) | ||
.mergeAll(); | ||
|
||
var subscription = source.subscribe( | ||
function (x) { | ||
console.log('Next: ' + x); | ||
}, | ||
function (err) { | ||
console.log('Error: ' + err); | ||
}, | ||
function () { | ||
console.log('Completed'); | ||
}); | ||
|
||
// => Next: 0 | ||
// => Next: 1 | ||
// => Next: 2 | ||
// => Completed | ||
``` | ||
|
||
### Location | ||
|
||
File: | ||
- [`/src/core/observable/manyselect.js`](https://github.com/Reactive-Extensions/RxJS/blob/master/src/core/linq/observable/manyselect.js) | ||
|
||
Dist: | ||
- [`rx.all.js`](https://github.com/Reactive-Extensions/RxJS/blob/master/rx.all.js) | ||
- [`rx.all.compat.js`](https://github.com/Reactive-Extensions/RxJS/blob/master/rx.all.compat.js) | ||
- [`rx.experimental.js`](https://github.com/Reactive-Extensions/RxJS/blob/master/rx.experimental.js) | ||
|
||
Prerequisites: | ||
- [`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/rx.lite.js) | [`rx.lite.compat.js`](https://github.com/Reactive-Extensions/RxJS/blob/master/rx.lite.compat.js) | ||
|
||
NPM Packages: | ||
- [`rx`](https://www.npmjs.org/package/rx) | ||
|
||
NuGet Packages: | ||
- [`RxJS-All`](http://www.nuget.org/packages/RxJS-All) | ||
- [`RxJS-Experimental`](http://www.nuget.org/packages/RxJS-Experimental) | ||
|
||
Unit Tests: | ||
- [`/tests/observable/manyselect.js`](https://github.com/Reactive-Extensions/RxJS/blob/master/tests/observable/manyselect.js) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
### `Rx.Observable.prototype.max([comparer])` | ||
[Ⓢ](https://github.com/Reactive-Extensions/RxJS/blob/master/src/core/linq/observable/max.js "View in source") | ||
|
||
Returns the maximum value in an observable sequence according to the specified comparer. | ||
|
||
#### Arguments | ||
1. `[comparer]` *(`Function`)*: Comparer used to compare elements. | ||
|
||
#### Returns | ||
*(`Observable`)*: An observable sequence containing a single element with the maximum element in the source sequence. | ||
|
||
#### Example | ||
```js | ||
/* Without comparer */ | ||
var source = Rx.Observable.fromArray([1,3,5,7,9,2,4,6,8]) | ||
.max(); | ||
|
||
var subscription = source.subscribe( | ||
function (x) { | ||
console.log('Next: ' + x); | ||
}, | ||
function (err) { | ||
console.log('Error: ' + err); | ||
}, | ||
function () { | ||
console.log('Completed'); | ||
}); | ||
|
||
// => Next: 9 | ||
// => Completed | ||
|
||
/* With a comparer */ | ||
function comparer (x, y) { | ||
if (x > y) { | ||
return 1; | ||
} else if (x < y) { | ||
return -1; | ||
} | ||
return 0; | ||
} | ||
|
||
var source = Rx.Observable.fromArray([1,3,5,7,9,2,4,6,8]) | ||
.max(comparer); | ||
|
||
var subscription = source.subscribe( | ||
function (x) { | ||
console.log('Next: ' + x); | ||
}, | ||
function (err) { | ||
console.log('Error: ' + err); | ||
}, | ||
function () { | ||
console.log('Completed'); | ||
}); | ||
|
||
// => Next: 9 | ||
// => Completed | ||
``` | ||
|
||
### Location | ||
|
||
File: | ||
- [`/src/core/observable/max.js`](https://github.com/Reactive-Extensions/RxJS/blob/master/src/core/linq/observable/max.js) | ||
|
||
Dist: | ||
- [`rx.all.js`](https://github.com/Reactive-Extensions/RxJS/blob/master/dist/rx.all.js) | ||
- [`rx.all.compat.js`](https://github.com/Reactive-Extensions/RxJS/blob/master/dist/rx.all.compat.js) | ||
- [`rx.aggregates.js`](https://github.com/Reactive-Extensions/RxJS/blob/master/rx.aggregates.js) | ||
|
||
Prerequisites: | ||
- [`rx.lite.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/rx.lite.js) | [`rx.lite.compat.js`](https://github.com/Reactive-Extensions/RxJS/blob/master/rx.lite.compat.js) | ||
|
||
NPM Packages: | ||
- [`rx`](https://www.npmjs.org/package/rx) | ||
|
||
NuGet Packages: | ||
- [`RxJS-All`](http://www.nuget.org/packages/RxJS-All/) | ||
- [`RxJS-Aggregates`](http://www.nuget.org/packages/RxJS-Aggregates/) | ||
|
||
Unit Tests: | ||
- [`/tests/observable/max.js`](https://github.com/Reactive-Extensions/RxJS/blob/master/tests/observable/max.js) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
### `Rx.Observable.prototype.maxBy(keySelector, [comparer])` | ||
[Ⓢ](https://github.com/Reactive-Extensions/RxJS/blob/master/src/core/linq/observable/maxby.js "View in source") | ||
|
||
Returns the maximum value in an observable sequence according to the specified comparer. | ||
|
||
#### Arguments | ||
1. `keySelector` *(`Function`)*: Key selector function. | ||
2. `[comparer]` *(`Function`)*: Comparer used to compare elements. | ||
|
||
#### Returns | ||
*(`Observable`)*: An observable sequence containing a list of zero or more elements that have a maximum key value. | ||
|
||
#### Example | ||
```js | ||
/* Without comparer */ | ||
var source = Rx.Observable.fromArray([1,3,5,7,9,2,4,6,8,9]) | ||
.maxBy(function (x) { return x; }); | ||
|
||
var subscription = source.subscribe( | ||
function (x) { | ||
console.log('Next: ' + x); | ||
}, | ||
function (err) { | ||
console.log('Error: ' + err); | ||
}, | ||
function () { | ||
console.log('Completed'); | ||
}); | ||
|
||
// => Next: 9,9 | ||
// => Completed | ||
``` | ||
|
||
### Location | ||
|
||
File: | ||
- [`/src/core/observable/maxby.js`](https://github.com/Reactive-Extensions/RxJS/blob/master/src/core/linq/observable/maxby.js) | ||
|
||
Dist: | ||
- [`rx.all.js`](https://github.com/Reactive-Extensions/RxJS/blob/master/dist/rx.all.js) | ||
- [`rx.all.compat.js`](https://github.com/Reactive-Extensions/RxJS/blob/master/dist/rx.all.compat.js) | ||
- [`rx.aggregates.js`](https://github.com/Reactive-Extensions/RxJS/blob/master/rx.aggregates.js) | ||
|
||
Prerequisites: | ||
- [`rx.lite.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/rx.lite.js) | [`rx.lite.compat.js`](https://github.com/Reactive-Extensions/RxJS/blob/master/rx.lite.compat.js) | ||
|
||
NPM Packages: | ||
- [`rx`](https://www.npmjs.org/package/rx) | ||
|
||
NuGet Packages: | ||
- [`RxJS-All`](http://www.nuget.org/packages/RxJS-All/) | ||
- [`RxJS-Aggregates`](http://www.nuget.org/packages/RxJS-Aggregates/) | ||
|
||
Unit Tests: | ||
- [`/tests/observable/maxby.js`](https://github.com/Reactive-Extensions/RxJS/blob/master/tests/observable/maxby.js) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
### `Rx.Observable.prototype.mergeAll()` | ||
### `Rx.Observable.prototype.mergeObservable()` *DEPRECATED* | ||
[Ⓢ](https://github.com/Reactive-Extensions/RxJS/blob/master/src/core/linq/observable/mergeobservable.js "View in source") | ||
|
||
Merges an observable sequence of observable sequences into an observable sequence. | ||
|
||
#### Returns | ||
*(`Observable`)*: The observable sequence that merges the elements of the inner sequences. | ||
|
||
#### Example | ||
```js | ||
var source = Rx.Observable.range(0, 3) | ||
.map(function (x) { return Rx.Observable.range(x, 3); }) | ||
.mergeAll(); | ||
|
||
var subscription = source.subscribe( | ||
function (x) { | ||
console.log('Next: ' + x); | ||
}, | ||
function (err) { | ||
console.log('Error: ' + err); | ||
}, | ||
function () { | ||
console.log('Completed'); | ||
}); | ||
|
||
// => Next: 0 | ||
// => Next: 1 | ||
// => Next: 1 | ||
// => Next: 2 | ||
// => Next: 2 | ||
// => Next: 2 | ||
// => Next: 3 | ||
// => Next: 3 | ||
// => Next: 4 | ||
// => Completed | ||
``` | ||
|
||
### Location | ||
|
||
File: | ||
- [`/src/core/observable/mergeobservable.js`](https://github.com/Reactive-Extensions/RxJS/blob/master/src/core/linq/observable/mergeobservable.js) | ||
|
||
Dist: | ||
- [`rx.all.js`](https://github.com/Reactive-Extensions/RxJS/blob/master/dist/rx.all.js) | ||
- [`rx.all.compat.js`](https://github.com/Reactive-Extensions/RxJS/blob/master/dist/rx.all.compat.js) | ||
- [`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/rx.lite.js) | ||
- [`rx.lite.compat.js`](https://github.com/Reactive-Extensions/RxJS/blob/master/rx.lite.compat.js) | ||
|
||
Prerequisites: | ||
- None | ||
|
||
NPM Packages: | ||
- [`rx`](https://www.npmjs.org/package/rx) | ||
|
||
NuGet Packages: | ||
- [`RxJS-All`](http://www.nuget.org/packages/RxJS-All/) | ||
- [`RxJS-Main`](http://www.nuget.org/packages/RxJS-Main/) | ||
- [`RxJS-Lite`](http://www.nuget.org/packages/RxJS-Lite/) | ||
|
||
Unit Tests: | ||
- [`/tests/observable/mergeobservable.js`](https://github.com/Reactive-Extensions/RxJS/blob/master/tests/observable/mergeobservable.js) |
Oops, something went wrong.