mirror of
https://github.com/wassname/talk.git
synced 2026-08-11 11:27:10 +08:00
19 lines
402 B
JavaScript
19 lines
402 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'});
|
|
},
|
|
};
|
|
}
|