[**@wocart/theme v4.1.0**](../../README)

***

[@wocart/theme](../../README) / [lifecycle](../README) / onEachPage

# Function: onEachPage()

> **onEachPage**(`boot`, `options?`): () => `void`

Runs `boot` for the page the shopper is on, and again for each page Astro's
router swaps in. Its teardown runs just before the page is swapped out, so
listeners on `document` or `window` never pile up from one page to the next.
Returns a function that stops it.

## Parameters

### boot

() => [`Teardown`](../type-aliases/Teardown)

### options?

[`LifecycleOptions`](../interfaces/LifecycleOptions)

## Returns

() => `void`
