Created
August 24, 2016 18:18
-
-
Save Willmo36/13b1fb3fa8fa5b12ba8c396367da2946 to your computer and use it in GitHub Desktop.
Wrap function call in a log
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const logFn = R.curry((msg, fn) => { | |
| return function () { | |
| console.info("Calling " + msg, arguments); | |
| const result = fn.apply(this, arguments); | |
| console.info("Result " + msg, result); | |
| return result; | |
| } | |
| }); | |
| console.logFn = logFn; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment