javascriptextjsextjs4extjs4.2

Are models really needed? what advantages do they give?


I have a store and I had a model attached to it, but I notice that either if my model is wrong (doesn't match JSON) or I remove my model completely from the store, it still works.

I would like to know what advantages / disadvantages this offers.

Why include models when they can be removed? I must admit I never saw any documentation stating the model can be excluded, but it seems to work.


Solution

  • The model is a storage object for data, that uses store. Model provides some helpful stuff like validations, data converters, providing data types, etc. Actually store doesn't work without model, if you don't provide concrete model, store will create default one and populate the data with autodetection the types of fields.