MCPcopy Create free account
hub / github.com/adobe/react-spectrum / emitStackChange

Function emitStackChange

packages/react-aria-components/src/Sheet.tsx:167–174  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

165let stackListeners = new Set<() => void>();
166
167function emitStackChange() {
168 // Hoist every mounted sheet's timeline name to the root so a parent
169 // can still resolve the child's timeline by name.
170 // TODO: don't override existing timelines declared in CSS or inline styles.
171 let names = sheetStack.map(sheet => sheet.timelineName).join(', ');
172 document.documentElement.style.setProperty('timeline-scope', names);
173 stackListeners.forEach(listener => listener());
174}
175
176function subscribeStack(listener: () => void) {
177 stackListeners.add(listener);

Callers 1

registerSheetFunction · 0.85

Calls 1

listenerFunction · 0.85

Tested by

no test coverage detected