apvarun / toastify-js

Pure JavaScript library for better notification messages
https://apvarun.github.io/toastify-js/
MIT License
2.13k stars 230 forks source link

Provide a 'onRemove' callback #40

Closed NullVoxPopuli closed 3 years ago

NullVoxPopuli commented 4 years ago

This'd be especially useful for integrating with async test frameworks

apvarun commented 4 years ago

There is already a callback property which takes in a function and is invoked when the toast is dismissed. I hope that handles your use-case.

madhavMathur commented 3 years ago

@apvarun Is the callback property also invoked when the user clicks on the toast, or is it exclusively for when the user hits the close icon?

apvarun commented 3 years ago

@madhavMathur : If you refer the API here, you will notice that there are two events.

  1. callback - invoked when the toast is dismissed, either by clicking on close or due to timer getting elapsed
  2. onClick - invoked when clicking on the element

I think your usecase may fit into one of these. Would love to hear your thoughts.

apvarun commented 3 years ago

Closing this due to inactivity