These are chat archives for ramda/ramda

30th
Jul 2016
Ryan Zeigler
@rzeigler
Jul 30 2016 00:38
is there any provision with lenses for a shortcircuiting, similar to path? It would be cool if I could over a value that might not be there and create a minimal structure such that it exists.
Jigar Gosar
@jigargosar
Jul 30 2016 10:51
@marszall87 I tend to create curried function with all the parameters, in your case 2, and call the function "project". or "fetchProject". to signify async nature.
Jigar Gosar
@jigargosar
Jul 30 2016 11:07
            var reduceWithIndex = _.addIndex(_.reduce);
            var zeroIndices = reduceWithIndex(function (zeroIndices, value, idx) {
                return value === 0 ? _.append(idx, zeroIndices) : zeroIndices;
            }, [], grid);
does this look good? or am I re-inventing the wheel
Michael Hurley
@buzzdecafe
Jul 30 2016 16:34
@jigargosar your solution lgtm. http://goo.gl/C6oiCx
Barry G
@bgits
Jul 30 2016 18:58
Given an array of objects, using ramda how can I return a new array where any object that pass this test R.has('name'); gets moved to the start of the array?
Raine Virta
@raine
Jul 30 2016 19:00
some kind of sortBy perhaps
Barry G
@bgits
Jul 30 2016 19:42
if I have a nested object with one field being an array, how would I return the object with the array now being sorted?
Raine Virta
@raine
Jul 30 2016 19:49
evolve or some kind of lens
Barry G
@bgits
Jul 30 2016 20:32
using evolve can I reference one field in another inside the transformation?