react-toastify icon indicating copy to clipboard operation
react-toastify copied to clipboard

Add queueLimit property to ToastContainer

Open xSyki opened this issue 3 years ago • 10 comments

Hi, I was working on the feature mentioned in "Limit the waiting queue to 2 toasts" #640 and here are my effects 😀 I hope you will like my implementation of this property.

My implementation seems to me to meet all the needs written in this discussion, as we can limit the queue length if we have a limit set, and disable the queue if we set the property to 0. By default, the property is undefied, so as it was, nothing will change for current react-toastify users.

For this feature I also wrote corresponding tests, but I am not a specialist in this topic and I will be happy to improve or add tests, because you certainly have a much greater authority on this topic.

I also edited the playground to be able to specify queueLimit in it, unfortunately I also had to delicately modify the css to fit the new property 😀

In the course of work, I also figured out that it might be a good idea to add a toast property "includeInQueue", for toasts that aren't important. Please let me know what you think about this idea, if I get approval, I will be happy to work on it as well.

xSyki avatar Sep 25 '22 09:09 xSyki

Coverage Status

Coverage increased (+0.07%) to 90.729% when pulling c0a8e52fc9119987c4b7d540624529a289772a07 on xSyki:queue-limit-property into 75525b15723bd1adf081cc4fa54edac46842f36e on fkhadra:main.

coveralls avatar Sep 25 '22 17:09 coveralls

Hi @fkhadra , What do you think about this pull request? Could you please take a look at it?

xSyki avatar Sep 28 '22 17:09 xSyki

Hey @xSyki thanks for the contribution. I'll do my best to review it this week

fkhadra avatar Oct 01 '22 12:10 fkhadra

any news?

nofear-js avatar Oct 25 '22 18:10 nofear-js

@fkhadra hey, any updates on this pull request?

cryptokoala4 avatar Dec 09 '22 05:12 cryptokoala4

@fkhadra Any news about this pr? Can you close it or merge it?

xSyki avatar Mar 04 '23 20:03 xSyki

@fkhadra Any updates about this PR? Or any other type of queueLimit feature for the library? It would be great to have a single place from where we can control such functionality, instead of passing a toastId to every place where a toast notification is being called.

pstevovski avatar Mar 23 '23 10:03 pstevovski

Looking for this option atm

rafalplonka avatar Aug 01 '23 11:08 rafalplonka

This really required feature, waiting for it

mohammedmrm avatar Oct 12 '23 10:10 mohammedmrm

waiting for it too

Trashnokdu avatar Oct 28 '23 13:10 Trashnokdu