Skip to content

Latest commit

 

History

History
23 lines (16 loc) · 558 Bytes

File metadata and controls

23 lines (16 loc) · 558 Bytes

API

English | 简体中文

headParams(fn, ...headArgs)

Returns a function that calls fn with headArgs followed by the arguments received by the returned function.

const logWithScope = headParams(console.log, '[build]')
logWithScope('started') // Output: [build] started

tailParams(fn, ...tailArgs)

Returns a function that calls fn with the arguments received by the returned function followed by tailArgs.

const logDone = tailParams(console.log, 'done')
logDone('build') // Output: build done