(toastId)
| 15 | } |
| 16 | const toastTimeouts = /* @__PURE__ */ new Map(); |
| 17 | const addToRemoveQueue = (toastId) => { |
| 18 | if (toastTimeouts.has(toastId)) { |
| 19 | return; |
| 20 | } |
| 21 | const timeout = setTimeout(() => { |
| 22 | toastTimeouts.delete(toastId); |
| 23 | dispatch({ |
| 24 | type: "REMOVE_TOAST", |
| 25 | toastId |
| 26 | }); |
| 27 | }, TOAST_REMOVE_DELAY); |
| 28 | toastTimeouts.set(toastId, timeout); |
| 29 | }; |
| 30 | export const reducer = (state, action) => { |
| 31 | switch (action.type) { |
| 32 | case "ADD_TOAST": |