Cogoport / cogo-toast

Beautiful, Zero Configuration, Toast Messages for React. Only ~ 4kb gzip, with styles and icons
https://cogoport.github.io/cogo-toast
MIT License
673 stars 1 forks source link

closing with some function #54

Closed MehdiAghighi closed 4 years ago

MehdiAghighi commented 4 years ago

i want a toast to be closed after my api call finished, not after an amount of time. what can i do ? thanks for your great library

anmdotdev commented 4 years ago

On execution, cogoToast returns an object with a hide function. Be sure to mark hideAfter as 0 in the options to never hide the toast unless the hide function is called.

See Example Below

const { hide } = cogoToast.success('This is a success message.', { hideAfter: 0 });

// When your API call completes.
hide();