hyper/lib/utils/notify.ts

11 lines
350 B
TypeScript
Raw Normal View History

2016-07-08 10:48:24 -08:00
/* eslint no-new:0 */
2019-10-12 02:16:45 -08:00
export default function notify(title: string, body: string, details: Record<string, any> = {}) {
//eslint-disable-next-line no-console
2016-07-13 12:44:24 -08:00
console.log(`[Notification] ${title}: ${body}`);
if (details.error) {
//eslint-disable-next-line no-console
console.error(details.error);
}
new Notification(title, {body});
2016-07-08 10:48:24 -08:00
}