mirror of
https://github.com/wassname/talk.git
synced 2026-06-29 17:21:58 +08:00
19 lines
525 B
JavaScript
19 lines
525 B
JavaScript
/**
|
|
* createNotificationService returns a notification services based on pym.
|
|
* @param {Object} pym
|
|
* @return {Object} notification service
|
|
*/
|
|
export function createNotificationService(pym) {
|
|
return {
|
|
success(text) {
|
|
pym.sendMessage('coral-alert', JSON.stringify({kind: 'success', text}));
|
|
},
|
|
error(text) {
|
|
pym.sendMessage('coral-alert', JSON.stringify({kind: 'error', text}));
|
|
},
|
|
info(text) {
|
|
pym.sendMessage('coral-alert', JSON.stringify({kind: 'info', text}));
|
|
},
|
|
};
|
|
}
|