MCPcopy Index your code
hub / github.com/developersdigest/llm-answer-engine / addToRemoveQueue

Function addToRemoveQueue

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 1

dispatchFunction · 0.85

Tested by

no test coverage detected