-
-
Save joepie91/30ff1e2e04e22b61eaf0ee3757572b23 to your computer and use it in GitHub Desktop.
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
"use strict"; | |
module.exports = function chainCalls(functions) { | |
return function (value) { | |
return functions.reduce((lastValue, func) => { | |
return func(lastValue); | |
}, value); | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment