I have a Store with items. The store can receive several suspendEvents(true)
and this will add to a counter each time it's called.
Example:
var myStore = //get store from somewhere
// myStore.eventsSuspended is 0
myStore.suspendEvents(true);
// myStore.eventsSuspended is 1
myStore.suspendEvents(true);
// myStore.eventsSuspended is 2
To resume events on the store resumeEvents()
has to be called twice. I've been looking around in the docs. but can't find a clean way to call resumeEvents()
and resume all events.
One of the solutions right know is:
do {
myStore.resumeEvents();
}
while (myStore.eventsSuspended > 0);
But it feels unsafe since if they change how this works in a later release this might cause unwanted behaviours that is hard to debug.
Any one got an idea on how to solve this?