Created
September 2, 2019 23:32
-
-
Save michalczukm/e34c2c51a580603892b4988261ae1391 to your computer and use it in GitHub Desktop.
Zip run commands - on array elements in same order
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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