mirror of
https://github.com/wassname/talk.git
synced 2026-07-20 12:40:47 +08:00
19 lines
408 B
JavaScript
19 lines
408 B
JavaScript
/**
|
|
* createNotificationService returns a notification services based on toast.
|
|
* @param {Object} toast
|
|
* @return {Object} notification service
|
|
*/
|
|
export function createNotificationService(toast) {
|
|
return {
|
|
success(msg) {
|
|
toast(msg, { type: 'success' });
|
|
},
|
|
error(msg) {
|
|
toast(msg, { type: 'error' });
|
|
},
|
|
info(msg) {
|
|
toast(msg, { type: 'info' });
|
|
},
|
|
};
|
|
}
|