MCPcopy Create free account
hub / github.com/admineral/OpenAI-Assistant-API-Chat / addToRemoveQueue

Function addToRemoveQueue

components/ui/use-toast.ts:59–73  ·  view source on GitHub ↗
(toastId: string)

Source from the content-addressed store, hash-verified

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

Callers 1

reducerFunction · 0.85

Calls 1

dispatchFunction · 0.85

Tested by

no test coverage detected