eslint-plugin-rxjs
eslint-plugin-rxjs copied to clipboard
is there a way to ban .asObservable() method
Hey,
wondering, is there a way to ban .asObservable()
method? Thanks.
// wrong
get click$(): Observable<void> {
return this._clickSubject$.asObservable();
}
// correct
get click$(): Observable<void> {
return this._clickSubject$;
}
I think, as long as there is not a fixed rule, you could use the restricted-syntax rule to define that rule yourself in your lint config.
But could you explain in which cases asObservable()
might be a problem?