AlexxNB / tinro

Highly declarative, tiny, dependency free router for Svelte's web applications.
MIT License
669 stars 30 forks source link

Reactive router behaviour #74

Closed ieow closed 3 years ago

ieow commented 3 years ago

Hi, I note that the reactive $router in the Book component does not update for Book in the route '/*' but do update for the Book in the path "/:genre/:author" when there is path changes.

I was expecting that the reactive router is updated on path changes like writable.

<Route path="/*" >
  <Route path="/:genre/:author"><Book/></Route>
  <Book />
</Route>

->repl https://svelte.dev/repl/2f6c12f28940451fb36e27ae9615f659?version=3.38.3

Which is the correct behavior?

ieow commented 3 years ago

I tried the announcer examples, it works fine

AlexxNB commented 3 years ago

router.params are deprecated many versions ago(did I leave any example which use it somewhere in readme?). It was replaced with meta.params because params are unic for each Route, according it's path pattern. https://github.com/AlexxNB/tinro#metaparams

ieow commented 3 years ago

I was checking the example in the issue #21 Did not notice it was deprecated. Thanks!

AlexxNB commented 3 years ago

IDE will warn you, when you try to use it =) image

ieow commented 3 years ago

I was testing with repl. Yupe, I tried in IDE just now, and it did warn me.