Skip to content

useNotivue


ts
import { useNotivue } from 'notivue'

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

In addition to that, the returned object exposes:

  • A readonly reactive property named isStreamPaused
  • A computed reactive property named isTopAlign
  • An 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)