push
Type:
(entry: Input, options?: HeadEntryOptions) => ActiveHeadEntry<Input>
Pushes an entry to the active head.
This is a lower-level function that is used internally with composable functions like useHead
.
Example
import { createHead } from 'unhead'const head = createHead()head.push({ title: 'Hello World'})
Using the Entry API
The push
function will not reactive to your data changes. You will need to use the returned entry API to handle lifecycle.
import { createHead } from 'unhead'const head = createHead()// push initialconst input = { title: 'Hello World' }const entry = head.push(input)// push changesinput.title = 'Hello World 2'entry.patch(entry)// remove entryentry.dispose()
Table of Contents