Skip to content

Instantly share code, notes, and snippets.

@ebeloded
Created May 26, 2021 23:51
Show Gist options
  • Save ebeloded/4f0561f1c682795dff5c721237adcf2f to your computer and use it in GitHub Desktop.
Save ebeloded/4f0561f1c682795dff5c721237adcf2f to your computer and use it in GitHub Desktop.
callWith
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