Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
elliotschi authored Sep 6, 2016
2 parents 0103940 + a61c8b2 commit 9ed4f54
Show file tree
Hide file tree
Showing 13 changed files with 679 additions and 74 deletions.
98 changes: 53 additions & 45 deletions MIGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,51 +71,50 @@ enabling "composite" subscription behavior.
|`windowWithTime`|`windowTime`|
|`windowWithCount`|`windowCount`|
|`where`|`filter`|
|`and`|`-`|
|`asObservable`|`-`|
|`average`|`-`|
|`controlled`|`-`|
|`delaySubscription`|`-`|
|`doWhile`|`-`|
|`extend`|`-`|
|`groupByUntil`|`-`|
|`groupJoin`|`-`|
|`includes`|`-`|
|`indexOf`|`-`|
|`join`|`-`|
|`jortSort`|`-`|
|`jortSortUntil`|`-`|
|`lastIndexOf`|`-`|
|`manySelect`|`-`|
|`maxBy`|`-`|
|`minBy`|`-`|
|`ofObjectChanges`|`-`|
|`pausable`|`-`|
|`pausableBuffered`|`-`|
|`shareReplay`|`-`|
|`shareValue`|`-`|
|`selectConcatObserver` or `concatMapObserver`|`-`|
|`selectManyObserver` or `flatMapObserver`|`-`|
|`sequenceEqual`|`-`|
|`singleInstance`|`-`|
|`skipLast`|`-`|
|`skipLastWithTime`|`-`|
|`skipUntilWithTime`|`-`|
|`slice`|`-`|
|`some`|`-`|
|`sum`|`-`|
|`takeLastBuffer`|`-`|
|`takeLastBufferWithTime`|`-`|
|`takeLastWithTime`|`-`|
|`takeUntilWithTime`|`-`|
|`tapOnNext`|`-`|
|`tapOnError`|`-`|
|`tapOnCompleted`|`-`|
|`timestamp`|`-`|
|`toMap`|`-`|
|`toSet`|`-`|
|`transduce`|`-`|
|`windowWithTimeOrCount`|`-`|
|`and`|Not yet implemented|
|`asObservable`|Not yet implemented|
|`average`|Not yet implemented|
|`controlled`|Not yet implemented|
|`delaySubscription`|Not yet implemented|
|`doWhile`|Not yet implemented|
|`extend`|Not yet implemented|
|`groupByUntil`|Not yet implemented|
|`groupJoin`|Not yet implemented|
|`includes`|Not yet implemented|
|`indexOf`|Not yet implemented|
|`join`|Not yet implemented|
|`jortSort`|Not yet implemented|
|`jortSortUntil`|Not yet implemented|
|`lastIndexOf`|Not yet implemented|
|`manySelect`|Not yet implemented|
|`maxBy`|Not yet implemented|
|`minBy`|Not yet implemented|
|`ofObjectChanges`|Not yet implemented|
|`pausable`|Not yet implemented|
|`pausableBuffered`|Not yet implemented|
|`shareReplay`|Not yet implemented|
|`shareValue`|Not yet implemented|
|`selectConcatObserver` or `concatMapObserver`|Not yet implemented|
|`selectManyObserver` or `flatMapObserver`|Not yet implemented|
|`singleInstance`|Not yet implemented|
|`skipLast`|Not yet implemented|
|`skipLastWithTime`|Not yet implemented|
|`skipUntilWithTime`|Not yet implemented|
|`slice`|Not yet implemented|
|`some`|Not yet implemented|
|`sum`|Not yet implemented|
|`takeLastBuffer`|Not yet implemented|
|`takeLastBufferWithTime`|Not yet implemented|
|`takeLastWithTime`|Not yet implemented|
|`takeUntilWithTime`|Not yet implemented|
|`tapOnNext`|`do`|
|`tapOnError`|`do`|
|`tapOnCompleted`|`do`|
|`timestamp`|Not yet implemented|
|`toMap`|Not yet implemented|
|`toSet`|Not yet implemented|
|`transduce`|Not yet implemented|
|`windowWithTimeOrCount`|Not yet implemented|

## Operator Splits

Expand Down Expand Up @@ -215,6 +214,15 @@ To reduce polymorphism and get better performance out of operators, some operato
<td><code>delay(subscriptionDelay?: Observable<any>, delayDurationSelector: function)</code></td>
<td><code>delayWhen(delayDurationSelector: function, subscriptionDelay?: Observable<any>)</code></td>
</tr>
<tr>
<td rowspan="2"><code>timeout</code></td>
<td><code>timeout(dueTime: number | Date, other?: Error, scheduler?: Scheduler)</code></td>
<td><code>timeout(due: number | Date, errorToSend?: any, scheduler?: Scheduler)</code></td>
</tr>
<tr>
<td><code>timeout(dueTime: number | Date, other?: Observable | Promise, scheduler?: Scheduler)</code></td>
<td><code>timeoutWith(due: number | Date, withObservable: ObservableInput, scheduler: Scheduler)</code></td>
</tr>
</tbody>
</table>

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,16 +108,16 @@ npm install @reactivex/rxjs@5.0.0-beta.1

### CDN

For CDN, you can use [npmcdn](https://npmcdn.com):
For CDN, you can use [unpkg](https://unpkg.com/):

5.0.0-beta.1 - 5.0.0-beta.11:

https://npmcdn.com/@reactivex/rxjs/dist/global/Rx.umd.js
https://unpkg.com/@reactivex/rxjs/dist/global/Rx.umd.js


5.0.0-beta.12 or higher:

https://npmcdn.com/@reactivex/rxjs/dist/global/Rx.umd.js
https://unpkg.com/@reactivex/rxjs/dist/global/Rx.js

#### Node.js Usage:

Expand Down
11 changes: 8 additions & 3 deletions doc/decision-tree-widget/tree.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,10 @@ children:
children:
- label: "where time windows are determined by another Observable's emissions"
children:
- label: inspect
- label: audit
- label: where time windows are determined by a time duration
children:
- label: inspectTime
- label: auditTime
- label: by emitting the last value as soon as enough silence has occured
children:
- label: where the silence duration threshold is determined by another Observable"
Expand Down Expand Up @@ -286,7 +286,12 @@ children:
children:
- label: I want to re-subscribe
children:
- label: repeat
- label: immediately
children:
- label: repeat
- label: when another Observable emits
children:
- label: repeatWhen
- label: I want to start a new Observable
children:
- label: concat
Expand Down
6 changes: 3 additions & 3 deletions doc/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,11 @@ npm install @reactivex/rxjs@5.0.0-beta.1

## CDN

For CDN, you can use [npmcdn](https://npmcdn.com). Just replace `version` with the current
For CDN, you can use [unpkg](https://unpkg.com). Just replace `version` with the current
version on the link below:

For RxJS 5.0.0-beta.1 through beta.11:
https://npmcdn.com/@reactivex/rxjs@version/dist/global/Rx.umd.js
https://unpkg.com/@reactivex/rxjs@version/dist/global/Rx.umd.js

For RxJS 5.0.0-beta.12 and higher:
https://npmcdn.com/@reactivex/rxjs@version/dist/global/Rx.js
https://unpkg.com/@reactivex/rxjs@version/dist/global/Rx.js
1 change: 1 addition & 0 deletions doc/operators.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ There are operators for different purposes, and they may be categorized as: crea
- [`never`](../class/es6/Observable.js~Observable.html#static-method-never)
- [`of`](../class/es6/Observable.js~Observable.html#static-method-of)
- `repeat`
- `repeatWhen`
- [`range`](../class/es6/Observable.js~Observable.html#static-method-range)
- [`throw`](../class/es6/Observable.js~Observable.html#static-method-throw)
- [`timer`](../class/es6/Observable.js~Observable.html#static-method-timer)
Expand Down
56 changes: 45 additions & 11 deletions spec/helpers/ajax-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,17 +117,17 @@ export class MockXMLHttpRequest {

private previousRequest: MockXMLHttpRequest;

private responseType: string = '';
protected responseType: string = '';
private eventHandlers: Array<any> = [];
private readyState: number = 0;

private user: any;
private password: any;

private responseHeaders: any;
private status: any;
private responseText: string;
private response: any;
protected status: any;
protected responseText: string;
protected response: any;

url: any;
method: any;
Expand Down Expand Up @@ -176,6 +176,18 @@ export class MockXMLHttpRequest {
this.triggerEvent('error');
}

protected jsonResponseValue(response: any) {
try {
this.response = JSON.parse(response.responseText);
} catch (err) {
throw new Error('unable to JSON.parse: \n' + response.responseText);
}
}

protected defaultResponseValue() {
throw new Error('unhandled type "' + this.responseType + '"');
}

respondWith(response: any): void {
this.readyState = 4;
this.responseHeaders = {
Expand All @@ -186,17 +198,13 @@ export class MockXMLHttpRequest {
if (!('response' in response)) {
switch (this.responseType) {
case 'json':
try {
this.response = JSON.parse(response.responseText);
} catch (err) {
throw new Error('unable to JSON.parse: \n' + response.responseText);
}
this.jsonResponseValue(response);
break;
case 'text':
this.response = response.responseText;
break;
default:
throw new Error('unhandled type "' + this.responseType + '"');
this.defaultResponseValue();
}
}
// TODO: pass better event to onload.
Expand All @@ -218,4 +226,30 @@ export class MockXMLHttpRequest {
}
});
}
}
}

export class MockXMLHttpRequestInternetExplorer extends MockXMLHttpRequest {

private mockHttp204() {
this.responseType = '';
this.responseText = '';
this.response = '';
}

protected jsonResponseValue(response: any) {
if (this.status == 204) {
this.mockHttp204();
return;
}
return super.jsonResponseValue(response);
}

protected defaultResponseValue() {
if (this.status == 204) {
this.mockHttp204();
return;
}
return super.defaultResponseValue();
}

}
Loading

0 comments on commit 9ed4f54

Please sign in to comment.