Created
April 5, 2018 06:14
-
-
Save MarcoWorms/a51c61a8511fc8e9d10fe9f04bbe9b6b to your computer and use it in GitHub Desktop.
This file contains 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
// 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