I am importing Subject
from rxjs
and then creating a property onSentenceChangeDebouncer
. In the constructor I am using this
so I am not sure why I am getting the error "is not assignable to method". It looks like it is related to the line with debounceTime(300)
.
Error TS2684 The 'this' context of type 'Subject<void>' is not assignable to method's 'this' of type 'Observable<void>'.
The types returned by 'lift(...)' are incompatible between these types.
Type 'Observable<void>' is not assignable to type 'Observable<R>'.
Type 'void' is not assignable to type 'R'.
'R' could be instantiated with an arbitrary type which could be unrelated to 'void'.
import { Subject } from "rxjs";
onSentenceChangeDebouncer: Subject<void> = new Subject<void>();
constructor(
this.onSentenceChangeDebouncer
.debounceTime(300)
.subscribe(() => {
this.updateConceptDependencies();
this.compileSentence();
});
}