UNPKG

react-universal-toast

Version:

A lightweight, customizable toast notification system for React applications with TypeScript support.

10 lines (9 loc) 387 B
import { toastStore } from "./toastStore"; export const toast = { show: (msg, opts) => toastStore.show(msg, opts), success: (msg) => toastStore.show(msg, { type: "success" }), error: (msg) => toastStore.show(msg, { type: "error" }), info: (msg) => toastStore.show(msg, { type: "info" }), remove: (id) => toastStore.remove(id), clear: () => toastStore.clear(), };