Skip to content
This repository was archived by the owner on Aug 18, 2020. It is now read-only.

Add local and global hooks for check current activity #10

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

stalkerg
Copy link

@stalkerg stalkerg commented Mar 1, 2018

Very often add active class not enough. For example for Bootstrap navigation panel, you should add class to a parent element. Why listen to history not enough too? Your route can contain params and you can't easily compare current location path and route path.
Extend RouterLink not possible because your route path can accessible from many URLs.
I know current solution a little hacky but maybe right now it's better than nothing.

I hope this project still active and will be the best solution for Svelte.

@stalkerg
Copy link
Author

stalkerg commented Mar 1, 2018

For example, https://github.com/TehShrike/svelte-state-renderer exist very useful function:
"asr.stateIsActive" it solves most of the problems with navigations.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant