Skip to content

Instantly share code, notes, and snippets.

@nicoespeon
Last active April 12, 2016 21:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nicoespeon/1d4fc94a6000d0e9a71ea30e4d56b3c4 to your computer and use it in GitHub Desktop.
Save nicoespeon/1d4fc94a6000d0e9a71ea30e4d56b3c4 to your computer and use it in GitHub Desktop.
Blog - Achieving point-free JavaScript - ramda refactored
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