MCPcopy Create free account
hub / github.com/CodeGraphContext/CodeGraphContext / addToRemoveQueue

Function addToRemoveQueue

website/src/hooks/use-toast.ts:55–69  ·  view source on GitHub ↗
(toastId: string)

Source from the content-addressed store, hash-verified

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

Callers 1

reducerFunction · 0.85

Calls 4

dispatchFunction · 0.85
hasMethod · 0.65
deleteMethod · 0.65
setMethod · 0.45

Tested by

no test coverage detected