Last active
April 12, 2016 21:06
-
-
Save nicoespeon/1d4fc94a6000d0e9a71ea30e4d56b3c4 to your computer and use it in GitHub Desktop.
Blog - Achieving point-free JavaScript - ramda refactored
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, pluck, converge, head, last} from 'ramda'; | |
import {daysSpent} from './utils/dates'; | |
// leadTime : [{date: Date}] -> Number | |
const leadTime = pipe( | |
pluck('date'), // first convert input into [Date] | |
converge( daysSpent, [ head, last ] ) // then pick proper ones for calculation | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment