@tempots/dom
runHeadless() function
Runs a renderable function in a headless environment.
Signature:
runHeadless: (makeRenderable: () => Renderable, { startUrl, selector, }?: {
startUrl?: Value<string>;
selector?: string;
}) => {
clear: (removeTree?: boolean) => void;
root: HeadlessPortal;
currentURL: import('..').Prop<string>;
}
Parameters
Parameter |
Type |
Description |
---|---|---|
makeRenderable |
() => Renderable |
A function that returns a Renderable to be rendered in the headless environment. |
{ startUrl, selector, } |
{ startUrl?: Value<string>; selector?: string; } |
(Optional) |
Returns: { clear: (removeTree?: boolean) => void; root: HeadlessPortal; currentURL: import('..').Prop<string>; }
An object containing the clear function, root element, and current URL Signal of the headless environment.