Skip to content

Instantly share code, notes, and snippets.

@dance2die dance2die/items.js
Created Jun 16, 2018

Embed
What would you like to do?
// 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())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.