()
| 103 | // There is a single global toast queue instance for the whole app, initialized lazily. |
| 104 | let globalToastQueue: ToastQueue<SpectrumToastValue> | null = null; |
| 105 | function 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 | |
| 118 | function addToast( |
| 119 | children: string, |
no outgoing calls
no test coverage detected