Skip to content

Instantly share code, notes, and snippets.

@michalczukm
Created September 2, 2019 23:32
Show Gist options
  • Save michalczukm/e34c2c51a580603892b4988261ae1391 to your computer and use it in GitHub Desktop.
Save michalczukm/e34c2c51a580603892b4988261ae1391 to your computer and use it in GitHub Desktop.

Revisions

  1. michalczukm created this gist Sep 2, 2019.
    3 changes: 3 additions & 0 deletions zipRun.ts
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,3 @@
    const zipRun: <T>(items: T[], commands: Array<(item: T) => unknown>) => void = (items, commands) => {
    items.forEach((item, index) => commands[index](item));
    }