I am trying to get values from a nested object using Ramda but I just started to use it. To get the testArray I used:
R.find(R.propEq('type', 'checklist'))((data))
Data is another array with different types but I need to focus only on 'checklist' type. I would like to get only items which have property "checked": true.
This is my array which I am trying to transform.
const testArray = [{
"type": "checklist",
"data": {
"items": [
{ "id": "r-1", "checked": true },
{ "id": "r-2", "checked": false }
]
}
}]
Edit: I made another step using:
R.path(['data', 'items'])
I got only items that I can simply filter. But I am not sure if it is the correct way to do that.
Any help will be appreciated.