Skip to content

Instantly share code, notes, and snippets.

@MarcoWorms
Created April 5, 2018 06:14
Embed
What would you like to do?
// http://ramdajs.com/docs/#pipe
const { pipe, curry } = require('ramda')
const addToTop = curry((card, deck) => [card, ...deck])
const addToBottom = curry((card, deck) => [...deck, card])
const addBoth = pipe(
addToTop({ name: 'Ice Wall', damage: 3, cost: 1 }),
addToBottom({ name: 'Earth Strike', damage: 6, cost: 3 })
)
const newDeck = addBoth(deck)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment