Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

useLocationHash #427

Open
jer3m01 opened this issue May 7, 2023 · 1 comment
Open

useLocationHash #427

jer3m01 opened this issue May 7, 2023 · 1 comment
Labels
enhancement New feature or request PRs welcome An issue which might not be prioritised right away but would be open to community contribution

Comments

@jer3m01
Copy link
Contributor

jer3m01 commented May 7, 2023

Describe The Problem To Be Solved

reactively use location hash

Suggest A Solution

const locationHash = useLocationHash();

createEffect(() => {
  console.log(locationHash()); // => '#' + string
});

https://developer.mozilla.org/en-US/docs/Web/API/Window/hashchange_event

@thetarnav
Copy link
Member

I was working on a url package long time ago, but dropped it because I didn't know what I was doing and solid-router provides similar functionality. But maybe it could be revived with a smaller, more focus scope.
This it createLocationState which was kinda doing that: https://github.com/solidjs-community/solid-primitives/blob/url/packages/url/src/location.ts#L113

@thetarnav thetarnav added enhancement New feature or request PRs welcome An issue which might not be prioritised right away but would be open to community contribution labels Sep 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request PRs welcome An issue which might not be prioritised right away but would be open to community contribution
Projects
None yet
Development

No branches or pull requests

2 participants