Skip to content

useNotivue


ts
import { useNotivue } from 'notivue'

Composable that returns an object with the same shape of the plugin configuration except that each property is a ref that allows for reactive updates and side effects.

In addition to that, it exposes:

  • Readonly reactive property named isStreamPaused
  • Computed reactive property named isTopAlign
  • update method that allows for "patching" the configuration with new options

Interfaces

ts
declare function useNotivue(): UseNotivueReturn

type UseNotivueReturn = ToRefs<NotivueConfigRequired> & {
  isTopAlign: ComputedRef<boolean>
  isStreamPaused: Readonly<Ref<boolean>>
  update: (newConfig: UpdateParam) => void
}

type UpdateParam =
  | NotivueConfig
  | ((config: NotivueConfigRequired) => NotivueConfig)