I am facing an issue with a child component where I need to remove properties from an object.
Normally, using Lodash, it should work with the following code snippet:
this.current.obj = omit(this.current.obj, ['sellerSupportWeb', 'sellerSupportAgency', 'sellerSupportAgent'])
However, the model of current.obj does not correspond to the parent component.
Interestingly, if I simply use the delete operator to remove the properties from the object, it works fine:
delete this.current.obj.sellerSupportAgency
delete this.current.obj.sellerSupportWeb
delete this.current.obj.sellerSupportAgent
Is there another alternative that achieves the same outcome as delete and omit?
Just for reference, in order to make it work with omit, I am accessing the parent object (parent component) within the child component. However, I am exploring other solutions since the current.obj situation is complex.
for (const [index] of this.current.parent.items.entries()) {
this.current.parent.items[index] = omit(this.current.parent.items[index], ['sellerSupportWeb', 'sellerSupportAgency', 'sellerSupportAgent'])
}