Created
May 26, 2021 23:51
-
-
Save ebeloded/4f0561f1c682795dff5c721237adcf2f to your computer and use it in GitHub Desktop.
callWith
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 call = | |
<A, B>(fn: (a: A) => B) => | |
(v: A): B => | |
fn(v) | |
const doCall = call((v: number) => { | |
return v.toString() | |
}) | |
const result = doCall(123) | |
console.log({ result }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment