MCPcopy Create free account
hub / github.com/PierreGode/Ragnar / setQueryRoot

Function setQueryRoot

web/rusense/app/lib.js:13–13  ·  view source on GitHub ↗
(root)

Source from the content-addressed store, hash-verified

11 * resolve inside the shadow island instead of the host document. */
12let _queryRoot = (typeof document !== 'undefined') ? document : null;
13export function setQueryRoot(root) { _queryRoot = root || _queryRoot; }
14/** querySelector shorthand scoped to the active query root (or an explicit root). */
15export const $ = (sel, root) => (root || _queryRoot).querySelector(sel);
16export const $$ = (sel, root) => [...(root || _queryRoot).querySelectorAll(sel)];

Callers 1

ensureShadowFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected