I am trying to check the following for empty values using lodash:
data.payload{
name: ""
}
My code:
import isEmpty from 'lodash.isempty';
if (isEmpty(data.payload)) {
The above is false, how can I validate for empty values?
I have this code in my helper:
export const isEmpty = some(obj, function(value) {
return value === '';
}
);
In my action I have
if (isEmpty(data.payload)) {
I get an error, ReferenceError: obj is not defined but I am passing the object...