fkhadra / fkhadra/react-toastify

Limit the waiting queue to 2 toasts

Open
#640 6 comments 2 reactions 1 assignee Claimed by @fkhadra View on GitHub
Feature Request
Dominant language
TypeScript
Stars
13.4k
Forks
741
PR merge metrics
No merged PRs in 30d

Description

**Do you want to request a *feature* or report a *bug*?**
feature

**What is the current behavior?**
When using `limit`, all pending toasts will be queued. Coming after a while, toasts will start playing from the most recent to the oldest one.

**What is the expected behavior?**
We would like to keep a `limit=1` with a `queueMax=2` (property not existing at the moment), so that we aren't spammed by toasts when coming back to the page after a while, especially since old toasts have become irrelevant by now.
We want to keep the 2 most recent notifications in the queue, thus the newest toast should remove the second oldest toast from the queue.

Would it be possible to add this new property to a container ? Or maybe add another param to `ClearWaitingQueueParams` when calling `toast.clearWaitingQueue` ?

Thank you for considering this feature.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.