Created
March 1, 2019 03:25
-
-
Save rjhilgefort/8b053d5922fbe6ec0d087fc4be80efe7 to your computer and use it in GitHub Desktop.
This file contains 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 { log, clear } = console; | |
clear(); | |
log('================================================='); | |
const add2 = (x, y) => x + y; | |
const add2P = (x, y) => Promise.resolve(x + y); | |
const logFn = | |
const logAdd2 = logFn(add2); | |
logAdd2(6, 4); | |
// // logs -> arguments: [1, 1] | |
// // logs -> result: 2 | |
// // returns -> 2 | |
const logAdd2P = logFn(add2P); | |
logAdd2P(2, 5); | |
// // logs -> arguments: [2, 5] | |
// // logs -> result: 7 | |
// // returns -> Promise<7> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment