Closed gotjoshua closed 6 years ago
What would be the difference with Object.assign(mInstance, { info: "newstring" })
?
Regarding new API proposals, something to keep in mind is that models aimed to be transparent wrappers around any kind of value/object. So we can't really modify instance prototypes, we can only act on the model layer. Such an addition would break every existing code using an object with an update
property, so it is likely to cause damage.
Yeah, good call... sometimes i seem to overlook the obvious, in my enthusiasm for the library...
Object assign should work anyway, as OM will check everything. Thanks again (for yet another basic js lesson : - / )
Haha no problem, I'm glad you propose new ideas for the library. I love to know how everyone uses my work and how can we improve it further.
Feature Request: We have a wish for a function that can do basically the same as ObjectModel({initObject}) with an {updateObject}, without destroying the initial instance/reference.
Wished Pseudo-Code Ex:
any chance you could save us some for looping with such a function?