Skip to content

Commit ec6ff11

Browse files
committed
feat(core): upgrade rxjs to 6.0.0-alpha.4
1 parent ed78457 commit ec6ff11

File tree

263 files changed

+9979
-1840
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

263 files changed

+9979
-1840
lines changed

aio/content/examples/component-interaction/src/app/astronaut.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import { Component, Input, OnDestroy } from '@angular/core';
33

44
import { MissionService } from './mission.service';
5-
import { Subscription } from 'rxjs/Subscription';
5+
import { Subscription } from 'rxjs';
66

77
@Component({
88
selector: 'app-astronaut',

aio/content/examples/component-interaction/src/app/mission.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// #docregion
22
import { Injectable } from '@angular/core';
3-
import { Subject } from 'rxjs/Subject';
3+
import { Subject } from 'rxjs';
44

55
@Injectable()
66
export class MissionService {

aio/content/examples/hierarchical-dependency-injection/src/app/heroes-list.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// #docregion
22
import { Component } from '@angular/core';
3-
import { Observable } from 'rxjs/Observable';
3+
import { Observable } from 'rxjs';
44

55
import { Hero, HeroTaxReturn } from './hero';
66
import { HeroesService } from './heroes.service';

aio/content/examples/hierarchical-dependency-injection/src/app/heroes.service.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { Injectable } from '@angular/core';
22

3-
import { Observable } from 'rxjs/Observable';
4-
import { Observer } from 'rxjs/Observer';
3+
import { Observable, Observer } from 'rxjs';
54

65
import { Hero, HeroTaxReturn } from './hero';
76

aio/content/examples/hierarchical-dependency-injection/src/app/villains-list.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// #docregion
22
import { Component } from '@angular/core';
3-
import { Observable } from 'rxjs/Observable';
3+
import { Observable } from 'rxjs';
44

55
import { Villain, VillainsService } from './villains.service';
66

aio/content/examples/hierarchical-dependency-injection/src/app/villains.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Injectable } from '@angular/core';
22

3-
import { of } from 'rxjs/observable/of';
3+
import { of } from 'rxjs';
44

55
export interface Villain { id: number; name: string; }
66

aio/content/examples/http/src/app/config/config.component.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export class ConfigComponent {
3030
this.configService.getConfig()
3131
// #enddocregion v1, v2
3232
.subscribe(
33-
data => this.config = { ...data }, // success path
33+
(data: Config) => this.config = { ...data }, // success path
3434
error => this.error = error // error path
3535
);
3636
}
@@ -39,7 +39,7 @@ export class ConfigComponent {
3939
showConfig_v1() {
4040
this.configService.getConfig_1()
4141
// #docregion v1, v1_callback
42-
.subscribe(data => this.config = {
42+
.subscribe((data: Config) => this.config = {
4343
heroesUrl: data['heroesUrl'],
4444
textfile: data['textfile']
4545
});
@@ -51,7 +51,7 @@ export class ConfigComponent {
5151
this.configService.getConfig()
5252
// #docregion v2, v2_callback
5353
// clone the data object, using its known Config shape
54-
.subscribe(data => this.config = { ...data });
54+
.subscribe((data: Config) => this.config = { ...data });
5555
// #enddocregion v2_callback
5656
}
5757
// #enddocregion v2

aio/content/examples/http/src/app/config/config.service.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ import { HttpClient } from '@angular/common/http';
66
import { HttpErrorResponse, HttpResponse } from '@angular/common/http';
77

88
// #docregion rxjs-imports
9-
import { Observable } from 'rxjs/Observable';
10-
import { ErrorObservable } from 'rxjs/observable/ErrorObservable';
9+
import { Observable, throwError } from 'rxjs';
1110
import { catchError, retry } from 'rxjs/operators';
1211
// #enddocregion rxjs-imports
1312

@@ -82,8 +81,8 @@ export class ConfigService {
8281
`Backend returned code ${error.status}, ` +
8382
`body was: ${error.error}`);
8483
}
85-
// return an ErrorObservable with a user-facing error message
86-
return new ErrorObservable(
84+
// return an observable with a user-facing error message
85+
return throwError(
8786
'Something bad happened; please try again later.');
8887
};
8988
// #enddocregion handleError

aio/content/examples/http/src/app/heroes/heroes.service.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ import { HttpHeaders } from '@angular/common/http';
66

77
// #enddocregion http-options
88

9-
import { Observable } from 'rxjs/Observable';
10-
import { of } from 'rxjs/observable/of';
9+
import { Observable } from 'rxjs';
1110
import { catchError } from 'rxjs/operators';
1211

1312
import { Hero } from './hero';

aio/content/examples/http/src/app/http-error-handler.service.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import { Injectable } from '@angular/core';
22
import { HttpErrorResponse } from '@angular/common/http';
33

4-
import { Observable } from 'rxjs/Observable';
5-
import { of } from 'rxjs/observable/of';
4+
import { Observable, of } from 'rxjs';
65

76
import { MessageService } from './message.service';
87

0 commit comments

Comments
 (0)