throttle m.route redraws

This commit is contained in:
Leo Horie 2016-12-04 01:53:39 -05:00
parent 7368cf6f26
commit 2ffd2fb7e4
9 changed files with 161 additions and 119 deletions

View file

@ -17,11 +17,11 @@ module.exports = function($window, redrawService) {
current.resolve = null
redrawService.render(root, current.render(Vnode(component, undefined, params)))
}
var run = routeService.defineRoutes(routes, function(component, params, path, route, isRouteChange) {
var run = routeService.defineRoutes(routes, function(component, params, path, route, isAction) {
if (component.view) render({}, component, params, path)
else {
if (component.onmatch) {
if (isRouteChange === false && current.path === path || current.resolve != null) render(current, current.component, params)
if (isAction === false && current.path === path || current.resolve != null) render(current, current.component, params)
else {
current.resolve = function(resolved) {
render(component, resolved, params, path)