MCPcopy
hub / github.com/calcom/cal.diy / addToRemoveQueue

Function addToRemoveQueue

packages/platform/atoms/src/components/ui/use-toast.ts:56–70  ·  view source on GitHub ↗
(toastId: string)

Source from the content-addressed store, hash-verified

54const toastTimeouts = new Map<string, ReturnType<typeof setTimeout>>();
55
56const addToRemoveQueue = (toastId: string) => {
57 if (toastTimeouts.has(toastId)) {
58 return;
59 }
60
61 const timeout = setTimeout(() => {
62 toastTimeouts.delete(toastId);
63 dispatch({
64 type: "REMOVE_TOAST",
65 toastId: toastId,
66 });
67 }, TOAST_REMOVE_DELAY);
68
69 toastTimeouts.set(toastId, timeout);
70};
71
72export const reducer = (state: State, action: Action): State => {
73 switch (action.type) {

Callers 1

reducerFunction · 0.85

Calls 4

hasMethod · 0.80
dispatchFunction · 0.70
deleteMethod · 0.65
setMethod · 0.45

Tested by

no test coverage detected