mirror of
https://github.com/wassname/talk.git
synced 2026-06-30 02:40:11 +08:00
19 lines
531 B
JavaScript
19 lines
531 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 }));
|
|
},
|
|
};
|
|
}
|