firebase - 尽管 promise 已解决,为什么还要调用 catch 案例?
问题描述
有人可以帮助我理解为什么调用 .catch 案例,尽管先前的承诺已成功解决? https://gist.github.com/defrian/fd6dd7f072754e833b60c7bd6ed45159 我收到的密码正确时(为什么它包含“有效负载”:“登录错误”?)
Array [
Object {
"type": "login_user",
},
Object {
"payload": Object {
"name": "signedUser",
},
"type": "login_user_success",
},
Object {
"payload": "Cannot read property 'dispatch' of undefined",
"type": "login_user_fail",
},
]
当我使用错误的密码时,我收到了(如我所料)
Array [
Object {
"type": "login_user",
},
Object {
"payload": "signIn error ",
"type": "login_user_fail",
},
]
解决方案
我发现了错误。它是由 NavigationService 调用引起的。当我使用 redux-thunk 时,我不得不将其更改为dispatch(() => NavigationService.navigate('Home'));
推荐阅读
- javascript - 如何在 VueJS 中传递道具?
- python - 尝试为测试组织点击 Salesforce API 时出现身份验证错误
- scala - df.schema 是动作还是转换?
- node.js - 在 fs.promises.writeFile 期间创建缺失目录的标志
- python - 如何将文本文件中的输入格式化为python中的defaultdict
- perl - 需要 PerlTk 中的文本框帮助
- javascript - nodejs从nodejs应用程序的不同文件夹执行二进制文件
- python - f.seek() 在 python 中读取额外的换行符或空格
- javascript - 我似乎无法从我的 express API 接收图像
- python - 在python中使用字符串格式时如何防止最后一位数字四舍五入?