diff --git a/README.md b/README.md index 3c9fcf1..cb5fc81 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ import RouteData from '@jack-henry/web-component-router/lib/route-data.js'; * These should match to named path segments. Each camel case name * is converted to a hyphenated name to be assigned to the element. * @param {boolean=} requiresAuthentication (optional - defaults true) - * @param {function():Promise=} beforeEnter Optionally allows you to dynamically import the component for a given route. The route-mixin.js will call your beforeEnter on routeEnter if the component does not exist in the dom. + * @param {function():Promise=} beforeEnter Optionally allows you to dynamically import the component for a given route. The route-mixin.js will call your beforeEnter on routeEnter if the component does not exist in the dom. */ const routeData = new RouteData( 'Name of this route', diff --git a/lib/route-data.js b/lib/route-data.js index 3280bbd..e9c2dbf 100644 --- a/lib/route-data.js +++ b/lib/route-data.js @@ -8,7 +8,7 @@ class RouteData { * @param {!Array=} namedParameters list in camelCase. Will be * converted to a map of camelCase and hyphenated. * @param {boolean=} requiresAuthentication - * @param {function():Promise=} beforeEnter + * @param {function():Promise|void=} beforeEnter */ constructor(id, tagName, path, namedParameters, requiresAuthentication, beforeEnter) { namedParameters = namedParameters || []; diff --git a/router.js b/router.js index 53a7c21..2daed52 100644 --- a/router.js +++ b/router.js @@ -23,7 +23,7 @@ * params: (Array|undefined), * authenticated: (boolean|undefined), * subRoutes: (Array|undefined), - * beforeEnter: (function():Promise|undefined) + * beforeEnter?: (function():Promise|void) * }} RouteConfig */ let RouteConfig;