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

What's the point of IsSupported? #175

Closed
notramo opened this issue Dec 9, 2024 · 2 comments
Closed

What's the point of IsSupported? #175

notramo opened this issue Dec 9, 2024 · 2 comments
Labels
documentation Improvements or additions to documentation

Comments

@notramo
Copy link

notramo commented Dec 9, 2024

Change Type

Addition

Proposed Changes

What is the point of IsSupported? The docs don't describe it.

Why can't I just use the following 2 solutions?

import { browser } from '$app/environment';

// set once, and doesn't change
const isSupportedStatic = browser && navigator && 'geolocation' in navigator;

// detect change automatically
const isSupportedDynamic = $derived(browser && navigator && 'geolocation' in navigator);
@notramo notramo added the documentation Improvements or additions to documentation label Dec 9, 2024
@abdel-17
Copy link
Collaborator

abdel-17 commented Dec 28, 2024

It's a port of the useSupported utility from VueUse.

https://vueuse.org/core/useSupported/

I agree that its utility is questionable. You don't even need the $derived because the expression never changes.

Thoughts? @huntabyte

@huntabyte
Copy link
Member

We could probably drop it tbh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

3 participants