raineorshine
3/28/2016 - 5:01 AM

Point-Free Style

Point-Free Style

const R = require('ramda')

// function declaration
const getTransformColor = (str) => str.slice(str.lastIndexOf(',')+2)

// point-free style
const getTransformColor = R.useWith(R.slice, [
  R.identity,
  R.pipe(R.lastIndexOf(','), R.add(2))
])