Skip to content

Hooks

Functions

useSuperglue()

useSuperglue(): SuperglueState

Defined in: hooks/index.ts:17

A lightweight hook that grabs the superglue state from the store.

Returns

SuperglueState


useFlash()

useFlash\<T>(): T

Defined in: hooks/index.ts:31

A hook that returns the current flash state from the store. Flash is cleared automatically on every visit.

Pass a type parameter to narrow the flash shape:

const flash = useFlash<{ notice?: string; alert?: string }>()

Type Parameters

Type Parameter Default type
T FlashState

Returns

T


useSetFlash()

useSetFlash(): { setFlash: (flash: FlashState) => void; clearFlash: (key?: string) => void; }

Defined in: hooks/index.ts:47

A hook that returns functions to set and clear flash messages on the client side.

const { setFlash, clearFlash } = useSetFlash()

setFlash({ notice: 'Saved!' })
clearFlash('notice')
clearFlash() // clears all

Returns

{ setFlash: (flash: FlashState) => void; clearFlash: (key?: string) => void; }

Name Type Defined in
setFlash() (flash: FlashState) => void hooks/index.ts:64
clearFlash() (key?: string) => void hooks/index.ts:64

References

useContent

Re-exports useContent


unproxy

Re-exports unproxy


useFragment

Re-exports useFragment


toFragmentRef

Re-exports toFragmentRef


useUpdateFragment

Re-exports useUpdateFragment


useUpdateContent

Re-exports useUpdateContent


useStreamSource

Re-exports useStreamSource