I am using a route guard (or resolver, I have tried to use either but got the same error) where I want to get Observable as a return value:
canActivate(): Observable<boolean> {
return this.store.pipe(
select(fromUserProfileState.getUserProfiles),
tap((loaded: UserProfile[]) => {
if (!loaded || loaded.length == 0) {
this.store.dispatch(new fromUserProfileActions.LoadUPs());
} else {
return of(true);
}
}),
filter((loaded: UserProfile[]) => loaded.length > 0),
first()
);
}
However, this doesn't return Observable, it returns Observable which is not acceptable. How can I tweak the rxjs (v 6.5.5) operators to return Observable only?