pateketrueke / yrv

Your routing vibes! (for Svelte)
https://svelte.dev/repl/0f07c6134b16432591a9a3a0095a80de
161 stars 9 forks source link

Using bind directive with activeRouter #4

Closed matthewrobb closed 4 years ago

matthewrobb commented 4 years ago

Hello!

Liking the library. Tried svero and couldn't make good sense of things, swapped in yrv and everything started making sense.

However I am interested in having activeRouter be an exported prop so that I can bind to it from the outside. Let me know how you feel about that and if desired I can submit a PR. Thanks!

pateketrueke commented 4 years ago

Oh, interesting, would you provide a usage-sample of this? Thank you!

matthewrobb commented 4 years ago

Basically similar to what happens now with let directives but I want to bind to a component local:

<script>let router;</script>
<Route bind:router />

I am using the router export for now but they are different and in some cases it would be more useful to be able to bind to that activeRoute that is currently exposed on the slot and available as a let directive.

pateketrueke commented 4 years ago

Still not sure what you're trying to achieve, but let me share what we have now:

Can you clarify why the latter one is what you want?