Last active
June 9, 2019 07:07
-
-
Save LinZap/4b75d72a0ab369e745b7a585a4b29a57 to your computer and use it in GitHub Desktop.
Node.js - HK4
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
/* | |
function connect(func1, func2) { | |
let data = { ...func1(), ...func2() } | |
return function (element) { | |
element(data)() | |
} | |
} | |
connect( | |
function () { | |
return { a: 100 } | |
}, | |
function () { | |
return { b: 200 } | |
} | |
)(function (data) { | |
return function () { | |
console.log(data) | |
} | |
}) | |
*/ | |
function connect(func1, func2) { | |
let data = { ...func1(), ...func2() } | |
return element => { element(data)() } | |
} | |
connect( | |
() => ({ a: 100 }), | |
() => ({ b: 200 }), | |
)(data => () => { | |
console.log(data) | |
}) |
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
{ a: 100, b: 200 } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment