underscore-es
Version:
javaScript's functional programming helper library for ES6 and beyond.
11 lines (9 loc) • 381 B
JavaScript
// `_wrap` : (ahem) a function's function
// ---------------------------------------
import _partial from './partial';
// Returns the first function passed as an argument to the second,
// allowing you to adjust arguments, run code before and after, and
// conditionally execute the original function.
export default function (func, wrapper) {
return _partial(wrapper, func);
}