mercredi 3 décembre 2014

ProxyStore.isLoaded - not robust enough?

I'm curious why the isLoaded method checks loadCount and not the length of data which IMO would be more robust.

It's possible for a store to contain data and have the loadCount equal zero for example by calling store.add on an empty store.



Code:



Ext.define('Ext.data.ProxyStore', {
extend: 'Ext.data.AbstractStore',
...
/**
* Returns `true` if the Store has been loaded.
* @return {Boolean} `true` if the Store has been loaded.
*/
isLoaded: function() {
// return this.loadCount > 0;
return this.data.length > 0
},
...





ProxyStore.isLoaded - not robust enough?

Aucun commentaire:

Enregistrer un commentaire