Skip to content

Releases: richie-south/fp-lib

curryDestructed

12 Jul 20:20
Compare
Choose a tag to compare

changelog

breaking

--

non breaking

  • curryObject fn is now curried for other params as well
  • implemented curryDestructed
    example
// add must have simple destruction! : no rest ... or nested destructions
const add = ({ a, b, c}) => a + b + c

const addC = curryObject(add)
addC({a: 1, b: 1, c: 1})     // >> 3
addC({a: 1})({b: 1})({c: 1}) // >> 3
addC({c: 1})({b: 1, a: 1})   // >> 3

first curry object

12 Jul 15:02
Compare
Choose a tag to compare

Changelog

breaking

--

non breaking

const addC = curryObject(objectTemplate, add)
addC({a: 1, b: 1, c: 1})     // >> 3
addC({a: 1})({b: 1})({c: 1}) // >> 3
addC({c: 1})({b: 1, a: 1})   // >> 3