wrap.js 301 B

12345678
  1. import partial from './partial.js';
  2. // Returns the first function passed as an argument to the second,
  3. // allowing you to adjust arguments, run code before and after, and
  4. // conditionally execute the original function.
  5. export default function wrap(func, wrapper) {
  6. return partial(wrapper, func);
  7. }