-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: allow to disable transition of link groups
- Loading branch information
1 parent
706d4d7
commit 01b07d7
Showing
4 changed files
with
22 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,16 @@ | ||
import { writable } from 'svelte/store' | ||
import { writable, derived } from 'svelte/store' | ||
|
||
/* | ||
* The store allows to avoid passing `activeUrl` and `onLinkClick` | ||
* as prop to every `NavigationLinkGroup` & `NavigationLink`. | ||
* The store allows to avoid unnecessary prop-drilling. | ||
*/ | ||
|
||
export const activeUrl = writable(null) | ||
|
||
export const onLinkClick = writable(null) | ||
|
||
export const transitionEnabled = writable(true) | ||
|
||
export const transitionDurationInMs = derived( | ||
transitionEnabled, | ||
($transitionEnabled) => ($transitionEnabled ? 250 : 0) | ||
) |