UNPKG

ramda-extension

Version:

Helpful functions built on top of the mighty Ramda

26 lines (23 loc) 652 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _ramda = require("ramda"); /** * Function with side-effect. Logs input to console and returns that input. * Similar to "log" but allows to label logged value. Should be used only in development. * * @func * @category Debugging * * @sig a -> b -> b * * @example * * compose(calculation2, R_.trace('Page A'), calculation1); // logs "Page A" and result of calculation1 * */ var trace = (0, _ramda.useWith)(_ramda.tap, [(0, _ramda.curryN)(2, console.log), _ramda.identity]); var _default = trace; exports.default = _default;