Skip to content

Commit 2f49cc4

Browse files
authored
feat(rxjs): update for rxjs 5.5+ and pipeable operators
Upgrade rxjs dep and convert to pipeable operators
2 parents 170c773 + 3a2a1e6 commit 2f49cc4

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
},
2828
"peerDependencies": {
2929
"@angular/router": "^5.0.0",
30-
"rxjs": "^5.0.3"
30+
"rxjs": "^5.5.5"
3131
},
3232
"devDependencies": {
3333
"@angular/cli": "^1.4.1",

src/app-insight.service.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import { Injectable, Optional } from '@angular/core';
22
import { Router, NavigationStart, NavigationEnd } from '@angular/router';
33
import { AppInsights } from 'applicationinsights-js';
4-
import 'rxjs/add/operator/filter';
4+
import { filter } from 'rxjs/operators/filter';
5+
56
import IAppInsights = Microsoft.ApplicationInsights.IAppInsights;
67

78
export class AppInsightsConfig implements Microsoft.ApplicationInsights.IConfig {
@@ -202,12 +203,16 @@ export class AppInsightsService implements IAppInsights {
202203
AppInsights.downloadAndSetup(this.config);
203204

204205
if (!this.config.overrideTrackPageMetrics) {
205-
this.router.events.filter(event => event instanceof NavigationStart)
206+
this.router.events.pipe(
207+
filter(event => event instanceof NavigationStart)
208+
)
206209
.subscribe((event: NavigationStart) => {
207210
this.startTrackPage(event.url);
208211
});
209212

210-
this.router.events.filter(event => event instanceof NavigationEnd)
213+
this.router.events.pipe(
214+
filter(event => event instanceof NavigationEnd)
215+
)
211216
.subscribe((event: NavigationEnd) => {
212217
this.stopTrackPage(event.url);
213218
});

0 commit comments

Comments
 (0)