Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Build item details map
- // for an O(1) look up for fetched item details
- const items = (await getStories(storyIds))
- .map(res => res.data)
- .filter(item => item !== null)
- .reduce((acc, item) => acc.set(item.id, item), new Map())
Add Comment
Please, Sign In to add comment