MCPcopy
hub / github.com/thebuilder/react-intersection-observer / getRootId

Function getRootId

src/observe.ts:31–37  ·  view source on GitHub ↗

* Generate a unique ID for the root element * @param root

(root: IntersectionObserverInit["root"])

Source from the content-addressed store, hash-verified

29 * @param root
30 */
31function getRootId(root: IntersectionObserverInit["root"]) {
32 if (!root) return "0";
33 if (RootIds.has(root)) return RootIds.get(root);
34 rootId += 1;
35 RootIds.set(root, rootId.toString());
36 return RootIds.get(root);
37}
38
39/**
40 * Convert the options to a string Id, based on the values.

Callers 1

optionsToIdFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…