tinro
tinro copied to clipboard
Use action parameters
I find it very odd to use exact
or active-class
attributes (even with data-*
). This feels like jQuery-esque 2008 era code and not like Svelte.
Can we migrate this to:
<a href="/page" use:active={{exact: true, activeClass: 'super-active'}}>Link</a>
?
Edit: This would even allow for a third argument, a function that returns a boolean. So that you can implement custom logic.
<a href="/page" use:active={{test: route => route.path.includes('some-token')}}>Link</a>
For tinro-ignore
I suggest a use:ignore
action that handles this behind the scenes. Either by adding a data-tinro-ignore
for you or by keeping a WeakSet<Node>
that you can test against inside aClickListener
(this would not pollute the DOM with an unnecessary attribute)
I like attributes notation more. Mustaches looks dirty.
Interesting, but Svelte uses Mustaches all over the place?
I mean double curves