Are you facing issues with using the lodash library to filter an array of objects? If the filter is returning the same value that was passed into it, there might be something wrong in your implementation. Here's the function I am using to transform data:
getFlattenFields(schema)
{
let flatten = _.flatten(schema.fields);
console.log('flatten',flatten);
let filtered = _.filter(flatten, item => item.element != 'loader' || item.element != 'button' );
console.log('filtered',filtered);
return filtered;
},
The `schema` variable being used is as follows:
formSchema:
{
fields:
[
[
{ id: 'email', label: '', default: '', element:'input', type: 'text' },
{ element: 'button', text:'Enviar', icon:'fas fa-reply' },
],
[
{ element: 'loader' },
]
]
}