Skip to content

Instantly share code, notes, and snippets.

@WaldoJeffers
Last active May 22, 2018 19:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save WaldoJeffers/39d9573c47c870e009367e8250a6a226 to your computer and use it in GitHub Desktop.
Save WaldoJeffers/39d9573c47c870e009367e8250a6a226 to your computer and use it in GitHub Desktop.
import { map } from 'conductor'
const character_ids = [1, 2, 3, 4, 5]
const fetchCharacter = id => fetch(`https://swapi.co/api/people/${id}`).then(res => res.json())
await map(fetchCharacter, characters_ids) // [{ name: 'Luke Skywalker }, { name: 'C-3PO' }, ...]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment