我正在使用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 )中使用了该函数,但没有运气。任何帮助将非常感激!