Skip to content

Instantly share code, notes, and snippets.

@joepie91

joepie91/.js Secret

Created May 17, 2019 09:54
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 joepie91/30ff1e2e04e22b61eaf0ee3757572b23 to your computer and use it in GitHub Desktop.
Save joepie91/30ff1e2e04e22b61eaf0ee3757572b23 to your computer and use it in GitHub Desktop.
"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