Skip to content

Commit 3f5745f

Browse files
authored
fix: path with params doesnt match (#10)
1 parent f0179d8 commit 3f5745f

2 files changed

Lines changed: 6 additions & 10 deletions

File tree

rollup.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export default [
4646
],
4747
output: {
4848
name: 'framework',
49-
file: pkg.browser,
49+
file: pkg.unpkg,
5050
format: 'umd',
5151
sourcemap: true,
5252
globals: {

src/app.ts

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,12 @@ export function createBrowserApplication(config: {
1616
const navigation = createNavigation(domain);
1717
forward({ from: config.ready, to: navigation.historyEmitCurrent });
1818

19-
const routesMatched = navigation.historyChanged.map((change) => ({
20-
routes: matchRoutes(config.routes, change.pathname),
21-
change,
22-
}));
23-
24-
const routeResolved = routesMatched.filterMap(({ routes, change }) => {
25-
const found = routes.find((route) => route.route.path === change.pathname);
26-
if (found) {
19+
const routeResolved = navigation.historyChanged.filterMap((change) => {
20+
const routes = matchRoutes(config.routes, change.pathname);
21+
22+
if (routes.length > 0) {
2723
return {
28-
...found,
24+
...routes[0],
2925
change,
3026
};
3127
}

0 commit comments

Comments
 (0)