title: How to wait until all ViewModel formulas are done changing in ExtJS?
body: <p>I'm working with the Ext JS framework. We have a fairly complex ViewModel with many formulas bound to other formulas. I'd like to be able to run some code only once the ViewModel has finished its long cascade of events triggering events. I'm trying to verify that, after all the ViewModel formulas have calculated, whether or not the data model remains identical to the expected values for the calculated fields returned from our API -- basically a deferred <code>model.isDirty()</code> check.</p>
  <p>I've tried using setTimeout to add my event to the end of the event queue, but it sometimes ends up firing in the middle of the formula-updating cascade. I could simply set a longer timeout, but that feels kludgey, would force the user to wait longer, and can't be guaranteed to work on a particularly slow browser.</p>
  <p>Is there a good way to run code as soon as the ViewModel is done calculating, and not a moment sooner?</p>
  <p>Is there a way to check whether or not the ViewModel is done?</p>
  <p>Is there a way to defer an event similarly to setTimeout, but to run only after the event queue becomes entirely empty?</p>