Re-initialise Basecoat after a swap
Description
Basecoat initialises its components on load and when new DOM is inserted, so this is only wanted where markup is restored from a cache rather than parsed.
Usage
bc_init(force = FALSE)
Arguments
| Argument | Description |
|---|---|
force |
Bool. Destroy and rebuild components that are already initialised, which also clears open menus and focus. |
Value
A <script> tag.
Details
For htmx history restores, where DOM comes back already initialised.
Examples
bc_init(force = TRUE)