UNPKG

@islands/hydration

Version:

Hydration utilities for îles

19 lines (17 loc) 531 B
import { onDispose } from "./chunk-AX6GSPTT.js"; // vanilla.ts var isFunction = (val) => typeof val === "function"; async function createIsland(component, id, el, props, slots) { if (isFunction(component)) { const dispose = await component(el, props, slots); if (import.meta.env.DISPOSE_ISLANDS && isFunction(dispose)) onDispose(id, dispose); } if (import.meta.env.DEV) window.__ILE_DEVTOOLS__?.onHydration({ id, el, props, slots, component, framework: "none" }); } export { createIsland as default };