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

Function getGlobalToastQueue

packages/@react-spectrum/s2/src/Toast.tsx:105–116  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

103// There is a single global toast queue instance for the whole app, initialized lazily.
104let globalToastQueue: ToastQueue<SpectrumToastValue> | null = null;
105function getGlobalToastQueue() {
106 if (!globalToastQueue) {
107 globalToastQueue = new ToastQueue({
108 maxVisibleToasts: Infinity,
109 wrapUpdate(fn, action) {
110 startViewTransition(fn, `toast-${action}`);
111 }
112 });
113 }
114
115 return globalToastQueue;
116}
117
118function addToast(
119 children: string,

Callers 2

addToastFunction · 0.70
ToastContainerFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected