Skip to content

useSupported

Category
Export Size
170 B
Last Changed
last month

SSR compatibility isSupported

Usage

ts
import { 
useSupported
} from '@vueuse/core'
const
isSupported
=
useSupported
(() =>
navigator
&& 'getBattery' in
navigator
)
if (
isSupported
.
value
) {
// do something
navigator
.getBattery
}

Type Declarations

ts
export declare function 
useSupported
(
callback
: () => unknown,
):
ComputedRef
<boolean>
export type
UseSupportedReturn
=
ReturnType
<typeof
useSupported
>

Source

SourceDocs

Contributors

SerKo
Robin
Anthony Fu
Anthony Fu
Fernando Fernández
Jelf

Changelog

v13.6.0 on
d32f8 - refactor: add @__NO_SIDE_EFFECTS__ annotations to all pure functions (#4907)
v12.8.0 on
9afee - feat(useCached): add options.deepRefs (#4591)
v12.0.0-beta.1 on
0a9ed - feat!: drop Vue 2 support, optimize bundles and clean up (#4349)

Released under the MIT License.

Join the Biggest FREE AI-Driven Development Event for Vue Developers
Save My Seat