I'm storing some session details using AsyncStorage and trying to use one of those stored session details in the withObservables as a part of the query. For example, assume that getCurrentFruitID is an async helper method to retrieve the fruitID from AsyncStorage. The code I am attempting to write looks like this:
compose(
withDatabase,
from(() => )
withObservables([], async ({database}) => ({
fruit: database
.get('fruits`)
.query(Q.where('fruit_id', await getCurrentFruitID()),
})),
)(Component)
but this results in an undefined is not an object error. I have taken a couple cracks at using the from function in RxJS (https://rxjs-dev.firebaseapp.com/api/index/function/from) as suggested by another person in the official forums but have had no luck. Any help would be much appreciated!