I'm trying to convert an old api that uses a lot of dot notation chaining which needs to be kept ie:
[1,2,3,4].newSlice(1,2).add(1) // [3]
I'd like to add the functional style of composition in this example Ramda but lodash or others would be fine:
const sliceAddOne = R.compose(add(1), newSlice(1,2))
sliceAddOne([1,2,3,4])// [3]
My question is how can I do both chaining and composition in my function newSlice
what would this function look like?
I have a little jsBin example.