Skip to content

New to NGRX following this example #33

Open
@bilpor

Description

@bilpor

Hi, I'm trying to follow this example, but am using angular cli 13.0 and ngrx 13.0.1. I've also refereced angular-auth-oidc-client 14.1.5.

I'm getting a couple of issues :

  1. in the auth.effect.ts file

checkauth$ = createEffect(() => this.actions$.pipe( ofType(fromAuthActions.checkAuth), switchMap(() => this.authService .checkAuth() .pipe( map((isLoggedIn) => fromAuthActions.checkAuthComplete({ isLoggedIn })) ) ) ) );

on the map line where IsLoggedIn get's passed, I receive LoginResponse is not assignable to type boolean

  1. auth.selectors.ts file

`export const selectIsAuthenticated = createSelector(
getAuthFeatureState,
(state: AuthState) => state.isLoggedIn
);

export const selectUserInfo = createSelector(
getAuthFeatureState,
(state: AuthState) => state.profile
);`

for both constants, the getAuthFeatureState fails with no overloads matches this call.

Update: for the selector errors, changing the const getAuthFetaureState to:
export const getAuthFeatureState = createFeatureSelector<AuthState>(authFeatureName);

resolves the 2 issues for the auth.selectors file, but I still have the auth.effects file issue

Apologies as I know I'm using a later library, but thought with your superior knowledge of this, that you may be able to help.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions