The phrasing of the rxjs 5-6 migration instructions, as well as blog posts like this one imply that simply by having 'rxjs-compat' as a dependency of our project alongside 'rxjs' then Observables, Subjects, etc imported from 'rxjs' will be compatible with legacy operators. eg. Observable.of(3, 4, 5).concatMap(num => {/*...*/}). However, this does not seem to be the case for us. Things do work somewhat as expected if we import directly from 'rxjs-compat' which doesn't seem to be the intended migration path and is also inconvenient in that the TypeScript declarations for 'rxjs' are more complete, and having imports for both 'rxjs' and 'rxjs-compat' in the same file will be mildly annoying to clean up in the future. Is there an additional step, or is importing from 'rxjs-compat' to be expected?

1

There are 1 best solutions below

2
On

Just refactor your code and don't use the compatibility layer.

Observable.of(3, 4, 5).concatMap(num => {/*...*/})

becomes

of(3, 4, 5).pipe(concatMap(num => {/*...*/}))

You will be much better off doing the refactor up front.