MCPcopy
hub / github.com/stackryze/FreeDomains / addToRemoveQueue

Function addToRemoveQueue

src/hooks/use-toast.js:17–29  ·  view source on GitHub ↗
(toastId)

Source from the content-addressed store, hash-verified

15}
16const toastTimeouts = /* @__PURE__ */ new Map();
17const 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};
30export const reducer = (state, action) => {
31 switch (action.type) {
32 case "ADD_TOAST":

Callers 1

reducerFunction · 0.70

Calls 1

dispatchFunction · 0.70

Tested by

no test coverage detected