These packages aim to provide developers with a set of commonly used components for building TokenE web applications.
yarn add @tokene/toasts
import { ToastPlugin } from '@tokene/toasts'
import '@tokene/toasts/dist/index.css'
app.use(ToastPlugin)
const { showTxToast, removeToast } = useNotifications()
lastToastId.value = showTxToast('pending', txLink!)
removeToast(lastToastId.value!)
showTxToast('success', txLink!)
import { ToolkitBus } from '@tokene/toolkit'
import { useNotifications, type NotificationPayload } from '@tokene/toasts'
const { showToast } = useNotifications()
ToolkitBus.on(Bus.eventList.success, payload =>
showToast('success', payload as NotificationPayload),
)
ToolkitBus.on(Bus.eventList.warning, payload =>
showToast('error', payload as NotificationPayload),
)
ToolkitBus.on(Bus.eventList.error, payload =>
showToast('warning', payload as NotificationPayload),
)
ToolkitBus.on(Bus.eventList.info, payload =>
showToast('info', payload as NotificationPayload),
)
ToolkitBus.on(Bus.eventList.default, payload =>
showToast('default', payload as NotificationPayload),
)
This project is licensed under the MIT License - see the LICENSE.md file for details
Generated using TypeDoc