I'm selecting from NgRx store @ngrx/store": "7.3.0".
// typeof state.id == string
export const selectIsSomethingPresent = createSelector(selector, state => {
// standard null check
return state.id && state.id !== "12345";
});
and I'm assigning it to an Observable
isSomethingPresent$ !: Observable<boolean>;
someMethod() {
this.isSomethingPresent$ = this.store.select(selectIsSomethingPresent);
}
I'm getting this error:
Type 'Observable<boolean | "">' is not assignable to type 'Observable<boolean>'.
Why does typescript act like that?
fyi return ("12345" && true) throws same error.