javascript - withObservables 和 await
问题描述
我正在使用AsyncStorage
并尝试在withObservables
查询中使用其中一个存储的会话详细信息来存储一些会话详细信息。例如,假设这getCurrentFruitID
是一个异步辅助方法来检索fruitID
from AsyncStorage
。我尝试编写的代码如下所示:
compose(
withDatabase,
from(() => )
withObservables([], async ({database}) => ({
fruit: database
.get('fruits`)
.query(Q.where('fruit_id', await getCurrentFruitID()),
})),
)(Component)
但这会导致undefined is not an object
错误。from
正如官方论坛中的另一个人所建议的那样,我在 RxJS ( https://rxjs-dev.firebaseapp.com/api/index/function/from )中使用了该函数,但没有运气。任何帮助将非常感激!
解决方案
推荐阅读
- javascript - 逗号分隔 React-Table 中的数组?
- javascript - 如何避免在网页返回时通过 JS 触发重复的 PubNub 通知
- c# - 远程服务器返回错误:(553) File name not allowed [C#] [FTP]
- c - 当给定 3 的位掩码时,为什么 printf() 打印 21 而不是 11?
- javascript - 使用 javaScript 重新加载特定的文本框/选择选项
- python - 将空白视频添加到音频的 Python 脚本(多个)
- matlab - 使用值中的空格逐行导入 ASCII 制表符分隔
- django - Django-allauth 没有在自定义 SignupForm 上保存附加字段
- javascript - 我如何将身份验证错误从节点 js 发送到我的 html 客户端页面?
- delphi - 如何使用 ReadPrinter?