Skip to content

Instantly share code, notes, and snippets.

@devdoomari3
Created February 17, 2020 02:41
Show Gist options
  • Save devdoomari3/3f4f49cfbddf99b3e8b11616ffdf4c46 to your computer and use it in GitHub Desktop.
Save devdoomari3/3f4f49cfbddf99b3e8b11616ffdf4c46 to your computer and use it in GitHub Desktop.
typescript_ramda_pipe.ts
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