From 5c984ac3e1a72d612fad2ff320e4097023686c9b Mon Sep 17 00:00:00 2001 From: Tobias Date: Sun, 19 May 2024 08:01:48 +0200 Subject: [PATCH 1/2] Docs: Improve search query routing part on search params --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 671ff5d..df6a4b7 100644 --- a/README.md +++ b/README.md @@ -114,12 +114,14 @@ createRouter({ ### Search Query Routing -Router value contains parsed `?a=1&b=2` search values: +Router value contains parsed url search params: ```js +createRouter({ home: '/posts/:category?sort=name' }) + location.href = '/posts/general?sort=name' router.get() //=> { -// path: '/posts/category', +// path: '/posts/general', // route: 'list', // params: { category: 'general' }, // search: { sort: 'name' } From f26cc8f4d12d7d6c344cdee29855424e81183579 Mon Sep 17 00:00:00 2001 From: Tobias Date: Sun, 19 May 2024 08:05:29 +0200 Subject: [PATCH 2/2] Docs: Fix example --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index df6a4b7..e0910e8 100644 --- a/README.md +++ b/README.md @@ -117,7 +117,7 @@ createRouter({ Router value contains parsed url search params: ```js -createRouter({ home: '/posts/:category?sort=name' }) +createRouter({ home: '/posts/:category' }) location.href = '/posts/general?sort=name' router.get() //=> {