Skip to content

Instantly share code, notes, and snippets.

@puemos
Last active May 6, 2018 07:50
Show Gist options
  • Save puemos/1628cfd26ad32f458e630c803887b54b to your computer and use it in GitHub Desktop.
Save puemos/1628cfd26ad32f458e630c803887b54b to your computer and use it in GitHub Desktop.
const segmentsCount = segments.length
// transform the segments list to an action list
const actions = segments.map((segment, index) =>
put(queueChannel, { payload: { uri: segment.uri, index, segmentsCount } })
)
// fire them all together
yield all(actions);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment