signout function in ngrx effect with()
- 主要语言
- TypeScript
- 星标
- 7.8k
- 派生
- 2.2k
- 平均合并
- 22 小时 28 分钟
- 30 天内合并 PR
- 6
描述
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 **

贡献指南
调研方向
从 auth.effects.ts 开始,重点检查 clearLocalstorageOnLogout$、其 createEffect 管道以及对 firebaseAuth.signOut(); 的调用;使用列出的 Angular、Firebase 和 AngularFire 版本,并启用运行时检查来复现 logout 流程。完成的标准是 signout 流程能够完成,且不会出现报告中的 read-only-property 或 unhandled-promise 错误。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- angular, firebase, typescript
- 领域
- authentication, frontend
- Issue 类型
- 缺陷
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 停滞
- 描述清晰度
- 需要澄清
- 新手友好度
- 35/100