Files
talk/client/coral-framework/services/notification.js
T
2017-08-24 18:40:38 +07:00

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}`);
},
};
}