Hello,
I have a use case where I want to dismiss a class of toasts at the same time (say, from a single event source that has disappeared), while leaving all others displayed or pending. I am using a ToastContainer with a limit of 2, so sometimes the toasts I want to dismiss early are still in the queue. There's a means to entirely clear the pending queue via toast.clearWaitingQueue, but this is too destructive for my needs as I want to preserve any waiting toasts that are not already filtered out.
I propose that toast.dismiss(id) be modified such that it not only dismisses any toast by that ID but also removes it from the pending queue. I think that should be sematically valid -- I can't think of a case where you'd want to dismiss a given toast but not also remove it from the pending queue if it's still there -- but if you prefer, I'd also be able to work with a toast.removeFromWaitingQueue(id) if the concepts should remain distinct.
I have a local commit that I can provide for PR that augments toast.dismiss(id) if you are amenable to this change.
Thank you for the excellent library!
Hello,
I have a use case where I want to dismiss a class of toasts at the same time (say, from a single event source that has disappeared), while leaving all others displayed or pending. I am using a
ToastContainerwith a limit of 2, so sometimes the toasts I want to dismiss early are still in the queue. There's a means to entirely clear the pending queue viatoast.clearWaitingQueue, but this is too destructive for my needs as I want to preserve any waiting toasts that are not already filtered out.I propose that
toast.dismiss(id)be modified such that it not only dismisses any toast by that ID but also removes it from the pending queue. I think that should be sematically valid -- I can't think of a case where you'd want to dismiss a given toast but not also remove it from the pending queue if it's still there -- but if you prefer, I'd also be able to work with atoast.removeFromWaitingQueue(id)if the concepts should remain distinct.I have a local commit that I can provide for PR that augments
toast.dismiss(id)if you are amenable to this change.Thank you for the excellent library!