1.0.1 • Published 2 years ago

@kayac/run-with-log v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

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