These are chat archives for ramda/ramda

14th
Mar 2019
Mike Chen
@mike442144
Mar 14 12:44
@bijoythomas yes, great code! many thanks , it will take me minutes to understand.
Scott Sauyet
@CrossEye
Mar 14 14:36
I haven't used unwind, but I can see the use. This looks like a fairly straightforward non-Ramda version:
const unwind = (prop) => (xs) => xs.map(({[prop]: ys, ...rest}) => ys.map(y => ({[prop]: y, ...rest}))).flat()
Mike Chen
@mike442144
Mar 14 14:38
emmm, your grammar seems strange, what is [prop]:ys and what is flat?
Riku Tiira
@rikutiira
Mar 14 14:38
that is native javascript
Mike Chen
@mike442144
Mar 14 14:38
do we have flat in native js?
Riku Tiira
@rikutiira
Mar 14 14:38
Mike Chen
@mike442144
Mar 14 14:40
Wow, it's awesome! All these features are introduced from v11.x?
Riku Tiira
@rikutiira
Mar 14 14:40
you mean node v11?
Mike Chen
@mike442144
Mar 14 14:41
yep
Riku Tiira
@rikutiira
Mar 14 14:41
These are still proposals so they aren’t in the language yet
Mike Chen
@mike442144
Mar 14 14:41
okay
Riku Tiira
@rikutiira
Mar 14 14:41
Except dynamic properties, that’s already in
Mike Chen
@mike442144
Mar 14 14:41
my first time to see it! dynamic props
Scott Sauyet
@CrossEye
Mar 14 14:42
Obviously we could use R.unnest or R.chain in place of flat.
Mike Chen
@mike442144
Mar 14 14:42
@CrossEye sure!!
Scott Sauyet
@CrossEye
Mar 14 14:43
I use Ramda for much less now that I'm working with modern JS. I still use it, of course, but there are many places where the syntax enhancements make it feel superfluous.