signout function in ngrx effect with()
- Ngôn ngữ chính
- TypeScript
- Star
- 7.8k
- Fork
- 2.2k
- Merge trung bình
- 22 giờ 28 phút
- Pull request đã merge (30 ngày)
- 6
Mô tả
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: ; 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: ; Task: Promise.then ; Value: TypeError: Cannot assign to read only property 'isRunning' of object '[object Object]'
```
** Screenshots **

Hướng dẫn đóng góp
Hướng nghiên cứu
Bắt đầu với auth.effects.ts, đặc biệt là clearLocalstorageOnLogout$, pipeline createEffect của nó và lệnh gọi firebaseAuth.signOut(); tái hiện luồng logout với các phiên bản Angular, Firebase và AngularFire được liệt kê cùng các bước kiểm tra runtime được bật. Được xem là hoàn tất khi luồng signout hoàn thành mà không gặp các lỗi read-only-property hoặc unhandled-promise đã được báo cáo.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- angular, firebase, typescript
- Lĩnh vực
- authentication, frontend
- Loại issue
- Lỗi
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Cần làm rõ
- Mức phù hợp với người mới
- 35/100