@@ -8,12 +8,11 @@ import {
8
8
Tree
9
9
} from '@angular-devkit/schematics' ;
10
10
import { FileSystemHost } from '@angular-devkit/schematics/tools' ;
11
- import { Observable } from 'rxjs/Observable ' ;
11
+ import { of as observableOf } from 'rxjs/observable/of ' ;
12
12
import * as path from 'path' ;
13
13
import chalk from 'chalk' ;
14
14
import { CliConfig } from '../models/config' ;
15
- import 'rxjs/add/operator/concatMap' ;
16
- import 'rxjs/add/operator/map' ;
15
+ import { concat , ignoreElements } from 'rxjs/operators' ;
17
16
import { getCollection , getSchematic } from '../utilities/schematics' ;
18
17
19
18
const { green, red, yellow } = chalk ;
@@ -58,7 +57,7 @@ export default Task.extend({
58
57
const opts = { ...taskOptions , ...preppedOptions } ;
59
58
60
59
const tree = emptyHost ? new EmptyTree ( ) : new FileSystemTree ( new FileSystemHost ( workingDir ) ) ;
61
- const host = Observable . of ( tree ) ;
60
+ const host = observableOf ( tree ) ;
62
61
63
62
const dryRunSink = new DryRunSink ( workingDir , opts . force ) ;
64
63
const fsSink = new FileSystemSink ( workingDir , opts . force ) ;
@@ -114,7 +113,9 @@ export default Task.extend({
114
113
schematic . call ( opts , host )
115
114
. map ( ( tree : Tree ) => Tree . optimize ( tree ) )
116
115
. 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 ) ) ) ;
118
119
} )
119
120
. concatMap ( ( tree : Tree ) => {
120
121
if ( ! error ) {
@@ -123,9 +124,11 @@ export default Task.extend({
123
124
}
124
125
125
126
if ( opts . dryRun || error ) {
126
- return Observable . of ( tree ) ;
127
+ return observableOf ( tree ) ;
127
128
}
128
- return fsSink . commit ( tree ) . ignoreElements ( ) . concat ( Observable . of ( tree ) ) ;
129
+ return fsSink . commit ( tree ) . pipe (
130
+ ignoreElements ( ) ,
131
+ concat ( observableOf ( tree ) ) ) ;
129
132
} )
130
133
. subscribe ( {
131
134
error ( err ) {
0 commit comments