Skip to content

Commit 09aa861

Browse files
committed
fix(@angular/cli): Use lettable operators.
Fixes #8912
1 parent 54e5863 commit 09aa861

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

packages/@angular/cli/tasks/schematic-run.ts

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,11 @@ import {
88
Tree
99
} from '@angular-devkit/schematics';
1010
import { FileSystemHost } from '@angular-devkit/schematics/tools';
11-
import { Observable } from 'rxjs/Observable';
11+
import { of as observableOf } from 'rxjs/observable/of';
1212
import * as path from 'path';
1313
import chalk from 'chalk';
1414
import { CliConfig } from '../models/config';
15-
import 'rxjs/add/operator/concatMap';
16-
import 'rxjs/add/operator/map';
15+
import { concat, ignoreElements } from 'rxjs/operators';
1716
import { getCollection, getSchematic } from '../utilities/schematics';
1817

1918
const { green, red, yellow } = chalk;
@@ -58,7 +57,7 @@ export default Task.extend({
5857
const opts = { ...taskOptions, ...preppedOptions };
5958

6059
const tree = emptyHost ? new EmptyTree() : new FileSystemTree(new FileSystemHost(workingDir));
61-
const host = Observable.of(tree);
60+
const host = observableOf(tree);
6261

6362
const dryRunSink = new DryRunSink(workingDir, opts.force);
6463
const fsSink = new FileSystemSink(workingDir, opts.force);
@@ -114,7 +113,9 @@ export default Task.extend({
114113
schematic.call(opts, host)
115114
.map((tree: Tree) => Tree.optimize(tree))
116115
.concatMap((tree: Tree) => {
117-
return dryRunSink.commit(tree).ignoreElements().concat(Observable.of(tree));
116+
return dryRunSink.commit(tree).pipe(
117+
ignoreElements(),
118+
concat(observableOf(tree)));
118119
})
119120
.concatMap((tree: Tree) => {
120121
if (!error) {
@@ -123,9 +124,11 @@ export default Task.extend({
123124
}
124125

125126
if (opts.dryRun || error) {
126-
return Observable.of(tree);
127+
return observableOf(tree);
127128
}
128-
return fsSink.commit(tree).ignoreElements().concat(Observable.of(tree));
129+
return fsSink.commit(tree).pipe(
130+
ignoreElements(),
131+
concat(observableOf(tree)));
129132
})
130133
.subscribe({
131134
error(err) {

0 commit comments

Comments
 (0)