API

Data

useFalseUntilTruthy

Description:

It's false until originalRef value is truthy. Then it will be true.

Typing:

function useFalseUntilTruthy (originalRef: Ref<any>): Readonly<Ref<boolean>>

useMemo

Description

Like computed. If computed value is not changed, component's render won't be triggered. Use it for performance.

Typing

function useMemo<T> (valueGenerator: () => T): DeepReadonly<Ref<T>>

useMergedState

Description

Merge controlled state and uncontrolled state. If controlled state value is not undefined, use controlledStateRef.value else use uncontrolledStateRef.value.

Typing

function useMergedState<T> (
  controlledStateRef: Ref<T>,
  uncontrolledStateRef: Ref<T>
): ComputedRef<T>

useCompitable

Description

Pick first non undefined value from an object.

Typing

function useCompitable<T extends object, V extends keyof T> (
  reactive: T,
  keys: V[]
): ComputedRef<T[GetArrayElementType<V[]>]> {

Vue

useIsMounted

Description

If component is mounted.

Typing

function isMounted (): Readonly<Ref<Boolean>>

DOM

useClickPosition

Description:

Last click position of mouse.

Typing:

function useClickPosition (): Readonly<Ref<MousePosition | undefined>>

useClicked

Description

It is true after clicked and before timeout is reached. Otherwise it is false.

Typing

function useClicked (timeout: number): Readonly<Ref<boolean>>

onFontsReady

Description

Triggered when fonts are ready in browser.

Typing

function onFontsReady (cb: () => any): void

useBreakpoints

Description The current covered breakpoints of browser window size.

Typing

function useBreakpoints (): ComputedRef<Breakpoint[]>
type Breakpoint = 'xs' | 's' | 'm' | 'l' | 'xl'

useBreakpoint

Description The current browser window size.

Typing

function useBreakpoint (): ComputedRef<Breakpoint>
type Breakpoint = 'xs' | 's' | 'm' | 'l' | 'xl'

OS

useOsTheme

Description:

Use the value of current OS theme.

Typing:

function useOsTheme (): Readonly<Ref<Theme | undefined>>

useIsIos

Description

If current OS is iOS

Typing

function useIsIos (): boolean