These are chat archives for ramda/ramda

19th
Feb 2019
Kirill
@kirillurgant
Feb 19 06:33

Hello everyone! Is it possible do it better?

dissoc('buttonQ', dissoc('viewQ', defaultConfig))

Kirill
@kirillurgant
Feb 19 06:42
I would like to pass properties array what I want to remove from source object. How can I do that? )
Kurt Milam
@kurtmilam
Feb 19 12:27

@kirill If you're up for partial.lenses, you can use L.propsExcept like this:

L.get(L.propsExcept('viewQ', 'buttonQ'), {id: 1, q: '?', viewQ: 1, buttonQ: 2})
// ->  { "id": 1, "q": "?" }

I'm pretty sure that will preform better than calling dissoc once per property you'd like to remove.

Ben Briggs
@ben-eb
Feb 19 15:10
@kirillurgant R.omit(['buttonQ', 'viewQ'])