Reputation: 3975
Just moved from rxjs 5/angular 5 to rxjs 6/ angular 6, went through this migration-guide. Can't seem to figure out what it should be now, any help appreciated.
import { Observable, of } from 'rxjs';
[ts] 'of' is declared but its value is never read.
// trivial example of what im trying to replace
isLoggedIn(): Observable<boolean> {
return Observable.of(true);
}
Upvotes: 21
Views: 18174
Reputation: 71
If you are using Angular 6 /7 or 9
import { of } from 'rxjs';
And then instead of calling
Observable.of(res);
just use
of(res);
Upvotes: 7
Reputation: 2872
You can now just import of
from rxjs
. So....
import { Observable, of } from 'rxjs';
// trivial example of what im trying to replace
isLoggedIn(): Observable<boolean> {
return of(true);
}
Upvotes: 34