Skip to content

Instantly share code, notes, and snippets.

@michalczukm
Created September 2, 2019 23:32
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 michalczukm/e34c2c51a580603892b4988261ae1391 to your computer and use it in GitHub Desktop.
Save michalczukm/e34c2c51a580603892b4988261ae1391 to your computer and use it in GitHub Desktop.
Zip run commands - on array elements in same order
const zipRun: <T>(items: T[], commands: Array<(item: T) => unknown>) => void = (items, commands) => {
items.forEach((item, index) => commands[index](item));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment