ensure redrawing in event handlers

This commit is contained in:
Leo Horie 2014-05-07 09:42:15 -04:00
parent 6fccbc0b0a
commit f321750896
2 changed files with 17 additions and 3 deletions

View file

@ -174,9 +174,8 @@ Mithril = m = new function app(window) {
function autoredraw(callback, object) {
return function(e) {
m.startComputation()
var output = callback.call(object, e)
m.endComputation()
return output
try {return callback.call(object, e)}
finally {m.endComputation()}
}
}