I need to switch a stream to an other stream, so I did
this.appState.domain$.pipe(switchMap(() => of(10))
It gives me an error
OperatorFunction<unknown, any>' is not assignable to parameter of type OperatorFunction<unknown, any>' ....
For me, the error doesn't really tell me what is happening or how to fix this. I would expect this to work, but something is off. Any suggestions why typescript is complaining?
CodePudding user response:
If you look closely, you have some mixup between rxjs libraries.
One is expecting /node_modules/rxjs/internal/types/Observable
vs. of(10) returning /node_modules/rxjs/dist/types/internal/types/Observable
Check your import line on the "of" operator, make sure its correct.