INNER CODE UNIT · TypeScript

addToRemoveQueue

mohammed-bahumaish/prisma-editor · src/hooks/use-toast.ts:58

const addToRemoveQueue = (toastId: string) => {
  if (toastTimeouts.has(toastId)) {
    return;
  }

  const timeout = setTimeout(() => {
    toastTimeouts.delete(toastId);
    dispatch({
      type: "REMOVE_TOAST",
      toastId: toastId,
    });
  }, TOAST_REMOVE_DELAY);

  toastTimeouts.set(toastId, timeout);
};

export const reducer = (state: State, action: Action): State => {
  switch (action.type) {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…