如何使用 Ramda remove 从对象数组中删除空对象?

How to use Ramda remove to remove empty object from Array of objects?

Ramda remove : Ramda Repl link

下面是给定的例子,它从数组中删除特定的数字:

R.remove(2, 3, [1,2,3,4,5,6,7,8]); //=> [1,2,6,7,8]

现在我创建了一个对象数组,其中一个是空的:

var objArray = [{id: 1, name: 'Leon'},{id: 2, name: 'Paulo'},{}];

当我尝试时:

R.remove({}, objArray);

R.remove(R.isEmpty, objArray);

它returns一个函数:

为什么会这样?

想通了:

const filteredAlerts = R.filter(Util.notEmpty, res.alerts);

我需要按非空对象进行过滤。

这是我的 Util.notEmpty 函数:

const notEmpty = R.compose(R.not, R.isEmpty);