Skip to content

Instantly share code, notes, and snippets.

@nicoespeon
Last active April 12, 2016 21:08
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/b2770bb0764a6cadd87b7e23253879dc to your computer and use it in GitHub Desktop.
Save nicoespeon/b2770bb0764a6cadd87b7e23253879dc to your computer and use it in GitHub Desktop.
Blog - Achieving point-free JavaScript - naive solution
import {pipe, prop, head, last} from 'ramda';
import {daysSpent} from './utils/dates';
// leadTime : [{date: Date}] -> Number
const leadTime = (items) => daysSpent(
pipe( head, prop('date') )(items),
pipe( last, prop('date') )(items)
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment