2 Commits

Author SHA1 Message Date
50e14811d4 1.0.5 2020-11-30 01:38:22 +00:00
f7e5af4113 fix(core): update 2020-11-30 01:38:21 +00:00
3 changed files with 4 additions and 4 deletions

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{
"name": "@pushrocks/smartrouter",
"version": "1.0.4",
"version": "1.0.5",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@ -1,6 +1,6 @@
{
"name": "@pushrocks/smartrouter",
"version": "1.0.4",
"version": "1.0.5",
"private": false,
"description": "a router for routing on websites",
"main": "dist_ts/index.js",

View File

@ -80,11 +80,11 @@ export class SmartRouter {
*/
async _handleRouteState() {
const currentLocation = window.location.pathname;
const wantedRoute = this.routes.find((routeArg) => {
const wantedRoutes = this.routes.filter((routeArg) => {
return !!routeArg.matchFunction(currentLocation);
});
if (wantedRoute) {
for (const wantedRoute of wantedRoutes) {
const routeResult = wantedRoute.matchFunction(currentLocation);
await wantedRoute.handler(routeResult.valueOf() as IRouteInfo);
}