Skip to content

Instantly share code, notes, and snippets.

@codingedgar
Last active August 30, 2018 14:52
Show Gist options
  • Save codingedgar/6426fb2014ad9ede5bc2dd26f49c33fc to your computer and use it in GitHub Desktop.
Save codingedgar/6426fb2014ad9ede5bc2dd26f49c33fc to your computer and use it in GitHub Desktop.
until transducer: composition
import { double_sum2_to_string } from './compose'
test('stringify after add 2 after double', () => {
expect(double_sum2_to_string([1, 2, 3])).toEqual(['4', '6', '8'])
})
import { compose, map } from 'ramda'
export const double_sum2_to_string =
compose(
map((number: number) => String(number)),
map((number: number) => number + 2),
map((number: number) => number * 2)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment