mirror of
https://github.com/wassname/talk.git
synced 2026-07-04 22:47:38 +08:00
19 lines
453 B
JavaScript
19 lines
453 B
JavaScript
/**
|
|
* createNotificationService returns a notification services based on pym.
|
|
* @param {Object} pym
|
|
* @return {Object} notification service
|
|
*/
|
|
export function createNotificationService(pym) {
|
|
return {
|
|
success(msg) {
|
|
pym.sendMessage('coral-alert', `success|${msg}`);
|
|
},
|
|
error(msg) {
|
|
pym.sendMessage('coral-alert', `error|${msg}`);
|
|
},
|
|
info(msg) {
|
|
pym.sendMessage('coral-alert', `info|${msg}`);
|
|
},
|
|
};
|
|
}
|