Query-Solid
Query-Solid copied to clipboard
Retrieve a raw list as values without having to use for await
This might already exist, but I didn't see it documented and I was not able to find it while doing a brief amount of code exploration.
Essentially, I'd like to be able to get all values fetched as an array without using for await.... This way I can perform fetches for subsequent values in parallel.
const friends = [];
const ldFriends = (await data.user.friends).listValue; // <-- List value does not exist currently. Right now, calling value will return only one of the values retreived
console.log(ldFriends);
await Promise.all(ldFriends.map(async ldFriend => {
console.log(ldFriend.value)
try {
friends.push({
name: (await data[ldFriend.value].vcard_fn).value,
webId: ldFriend.value
})
} catch(err) {}
}))
this.setState({ friends });
suggestion: .all?
Yeah. .all sounds good.