Lint the router files

This commit is contained in:
Pierre-Yves Gerardy 2016-09-03 00:32:12 +02:00
parent 0539fc651d
commit a1131eb4f2
2 changed files with 6 additions and 6 deletions

View file

@ -10,7 +10,7 @@ module.exports = function($window, mount) {
var RouteComponent = {view: function() {
return currentRender(Vnode(currentComponent, null, currentArgs, undefined, undefined, undefined))
}}
function defaultRender(vnode){
function defaultRender(vnode) {
return vnode
}
var route = function(root, defaultRoute, routes) {
@ -20,7 +20,7 @@ module.exports = function($window, mount) {
mount(root, RouteComponent)
router.defineRoutes(routes, function(payload, args, path, route) {
router.defineRoutes(routes, function(payload, args, path) {
var resolutionIdentifier = globalId = {}
var isResolver = typeof payload.view !== "function"
var render = defaultRender
@ -29,14 +29,14 @@ module.exports = function($window, mount) {
if (resolutionIdentifier !== globalId) return
globalId = null
currentComponent = component != null ? component: isResolver ? "div" : payload
currentComponent = component != null ? component : isResolver ? "div" : payload
currentRender = render
currentArgs = args
currentPath = path
root.redraw(true)
}
function onmatch() {
var onmatch = function() {
resolve()
}
if (isResolver) {

View file

@ -18,9 +18,9 @@ module.exports = function($window) {
var asyncId
function debounceAsync(f) {
return function(){
return function() {
if (asyncId != null) return
asyncId = callAsync(function(){
asyncId = callAsync(function() {
asyncId = null
f()
})