Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Apply VueUse composables in Vue 3/Nuxt projects to replace custom implementations with battle-tested utilities.
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
references/useSupported.md
1---2category: Utilities3---45# useSupported67SSR compatibility `isSupported`89## Usage1011```ts12import { useSupported } from '@vueuse/core'1314const isSupported = useSupported(() => navigator && 'getBattery' in navigator)1516if (isSupported.value) {17// do something18navigator.getBattery19}20```2122## Type Declarations2324```ts25export type UseSupportedReturn = ComputedRef<boolean>26export declare function useSupported(27callback: () => unknown,28): UseSupportedReturn29```30