How can I clear previous toastr before showing the new one and set a timeout between them?

Petya Naumova picture Petya Naumova · Dec 6, 2016 · Viewed 8.9k times · Source

I am using Angular toastr and I am stuck at passing a delay between hiding the previous toastr and showing the next one. There should be only one toastr at a time. I am hiding and showing it, but there is no visual difference, and still the toast messages are the same, the user is not able to distinguish which was previous and wich is next toast. I am firing them with two functions. Any help would be appreciated.

This is my setup:

        autoDismiss: true,
        maxOpened: 2,
        newestOnTop: true,
        extendedTimeOut: 1000,
        tapToDismiss: false,
        timeOut: 5000

Answer

Ghazanfar Khan picture Ghazanfar Khan · Dec 6, 2016

Immediately remove current toasts without using animation

toastr.remove()

Remove current toasts using animation

toastr.clear()

Every thing is mention on github