rubico
Version:
[a]synchronous functional programming
17 lines (15 loc) • 335 B
JavaScript
/**
* @name thunkifyArgs
*
* @synopsis
* ```coffeescript [specscript]
* thunkifyArgs(func function, args Array) -> ()=>func(...args)
* ```
*
* @synopsis
* Create a thunk from a function and an arguments array.
*/
const thunkifyArgs = (func, args) => function thunk() {
return func(...args)
}
module.exports = thunkifyArgs