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?
Importing from 'rxjs' with 'rxjs-compat' present as an additional dependency does not make compatible Observables
192 Views Asked by anomico At
1
Just refactor your code and don't use the compatibility layer.
becomes
You will be much better off doing the refactor up front.