computer-scienceangular-roadmapbackend-roadmapblockchain-roadmapdba-roadmapdeveloper-roadmapdevops-roadmapfrontend-roadmapgo-roadmaphactoberfestjava-roadmapjavascript-roadmapnodejs-roadmappython-roadmapqa-roadmapreact-roadmaproadmapstudy-planvue-roadmapweb3-roadmap
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
617 B
24 lines
617 B
1 year ago
|
import { $toastMessage } from '../stores/toast';
|
||
|
|
||
|
export function useToast() {
|
||
|
function success(message: string) {
|
||
|
$toastMessage.set({ type: 'success', message });
|
||
|
}
|
||
|
function error(message: string) {
|
||
|
$toastMessage.set({ type: 'error', message });
|
||
|
}
|
||
|
function info(message: string) {
|
||
|
$toastMessage.set({ type: 'info', message });
|
||
|
}
|
||
|
|
||
|
function warning(message: string) {
|
||
|
$toastMessage.set({ type: 'warning', message });
|
||
|
}
|
||
|
|
||
|
function loading(message: string) {
|
||
|
$toastMessage.set({ type: 'loading', message });
|
||
|
}
|
||
|
|
||
|
return { success, error, info, warning, loading, $toastMessage };
|
||
|
}
|