@kayac/run-with-log
v1.0.1
Published
wrap function with custom log message function
Downloads
3
Maintainers
Readme
Run With Log
wrap function with custom log message function.
Install
npm install @kaya/run-with-log
Usage
import runWithLog from "@kaya/run-with-log";
const add = (a, b) => a + b;
const addWithLog = runWithLog(
([x, y], result) => `${x} + ${y} = ${result}`,
add
);
const result = addWithLog(1, 1); //=> print "1 + 1 = 2"
// result === 2