omnibelt/throttle.js

  1. const compose = require('ramda/src/compose');
  2. const curryN = require('ramda/src/curryN');
  3. const flip = require('lodash/fp/flip');
  4. const _throttle = require('lodash/throttle');
  5. /**
  6. * @signature Object -> Number -> Function -> Function
  7. */
  8. const throttle = compose(curryN(3), flip)(_throttle);
  9. module.exports = throttle;