Refactor start/endComputation into lazyRedraw method

This commit is contained in:
Toby Zerner
2015-08-31 12:04:51 +09:30
parent 9f28b4e8dc
commit 0474f410a4
5 changed files with 14 additions and 16 deletions

View File

@ -13,5 +13,15 @@ export default function patchMithril(global) {
Object.keys(mo).forEach(key => m[key] = mo[key]);
/**
* Redraw only if not in the middle of a computation (e.g. a route change).
*
* @return {void}
*/
m.lazyRedraw = function() {
m.startComputation();
m.endComputation();
};
global.m = m;
}