useToasts
Returned from
initToast
Listens to and lets you remove toasts.
Arguments
Takes one optional argument, which is a options object:
onToastAdded?:(toast: T & { id: string }) => voidA callback for whenever a toast is fired.removeToastsAfterMs?:number | undefinedSpecifies the default timeout for toasts to be auto-removed. (undefined = no auto removal).
Returns
toasts:Array<T & { id: string }>The list of current toastsonRemoveToast:(toastId: string) => voidThe list of current toastscancelToastTimeout:(toastId: string) => voidCancels whatever timeout the given toast has for removing itself.restartToastTimeout:(toastId: string, removeAfterMs?: number) => voidRestarts whatever timeout the given toast has for removing itself.