Created
February 17, 2020 02:41
-
-
Save devdoomari3/3f4f49cfbddf99b3e8b11616ffdf4c46 to your computer and use it in GitHub Desktop.
typescript_ramda_pipe.ts
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
import { pipe } from 'ramda' | |
export function addB<T>(i: T) { | |
return { | |
...i, | |
b: 2, | |
} | |
} | |
export function addC<T>(i: T) { | |
return { | |
...i, | |
c: 2, | |
} | |
} | |
const something = {a: 1} | |
const result = pipe(addC, addB)(something) | |
// const result: { | |
// a: number; | |
// } & { | |
// c: number; | |
// } & { | |
// b: number; | |
// } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment