Skip to content

signout function in ngrx effect with() #3251

Open
@AsimNet

Description

@AsimNet

Hello,
I have an NGRX in my project, and when I sign user out I got the error explained below, please notice that I use NGRX with:

runtimeChecks: {
          strictStateImmutability: true,
          strictActionImmutability: true,
        },

Version info

Angular:
~13.3.0
Firebase:
^9.1.0
AngularFire:
^7.2.1

How to reproduce these conditions

auth.effects.ts:

  clearLocalstorageOnLogout$ = createEffect(
    () =>
      this.actions$.pipe(
        ofType(AuthActions.logout),
        tap(async () => {
          // @todo: there is a bug here
          await this.firebaseAuth.signOut();
        }),
      ),
    {dispatch: false}
  );

  constructor(
    private readonly actions$: Actions,
    private firebaseAuth: Auth,
    private router: Router,
  ) {
  }

Debug output

** Errors in the JavaScript console **

Unhandled Promise rejection: Cannot assign to read only property 'operations' of object '[object Object]' ; Zone: <root> ; Task: Promise.then ; Value: TypeError: Cannot assign to read only property 'operations' of object '[object Object]'

Unhandled Promise rejection: Cannot assign to read only property 'isRunning' of object '[object Object]' ; Zone: <root> ; Task: Promise.then ; Value: TypeError: Cannot assign to read only property 'isRunning' of object '[object Object]'

** Screenshots **
Screen Shot 1444-01-05 at 9 35 49 PM
Screen Shot 1444-01-05 at 9 35 41 PM

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions