Closed benjaminkwokhuen closed 2 years ago
I'm not opposed to this change, but I'm wonder why you want this? I always found this behavior in mobx-state-tree to be confusing. I rather just massage the incoming data if I need to remove some properties.
Image you have a deeply nested structure that the backend api returns. While, like you said, you can massage the incoming data to remove some properties, but sometimes the function can be quite complicated to write (e.g. a deeply nested structure that contains fields you partially need), which in turns increase the complexity.
I personally like the default behavior of MST, in which data that is not defined in the schema will be automatically omitted.
After getting the result from the server, if the data does not have a property define in the model, mst-query will throw an error
xxx property missing from xxxModel model
In MST, if a property is not defined in the model, it will ignore it. I would like to have that behavior.