Ramda remove : Ramda Repl link
The following is the given example, it removes specific numbers from an Array:
R.remove(2, 3, [1,2,3,4,5,6,7,8]); //=> [1,2,6,7,8]
Now I created an Array of objects, one being empty:
var objArray = [{id: 1, name: 'Leon'},{id: 2, name: 'Paulo'},{}];
When I try:
R.remove({}, objArray);
or
R.remove(R.isEmpty, objArray);
It returns a function:
Why would that be you suppose?
Figured it out:
const filteredAlerts = R.filter(Util.notEmpty, res.alerts);
I needed to filter by objects that are NOT empty.
This is my Util.notEmpty
function:
const notEmpty = R.compose(R.not, R.isEmpty);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With