0
I looked at the example in a Github repository. The application runs successfully and the written code works normally, but I have the following error in my Visual Studio Code:
The 'this' context of type 'Eventemitter' is not Assignable to method’s 'this' of type 'Observable'. n Types of Property 'lift' are incompatible. Type '(Operator: Operator) => Observable' is not Assignable to type '(Operator: Operator) => Observable'. Type 'Observable' is not Assignable to type 'Observable'. n Type 'string' is not Assignable to type 'R'.
The code that is generating the error is as follows:
this.notificationService.notifier
.do(message => {
this.message = message;
this.snackVisibility = 'visible';
})
.switchMap(message => Observable.timer(2000))
.subscribe(timer => this.snackVisibility = 'hidden');
Although the application works perfectly VS Code presents me the error as shown in the image:
What would be the best solution for this error?
If you can put in your code
this.notificationService.notifier
, kindly– Patrick Lima