alpinejs-desktop-notify
Version:
Create desktop notifications with Alpine JS 📣
2 lines (1 loc) • 325 B
JavaScript
function n(e){e.magic("notify",()=>(i={})=>{let f="Notification"in window,r=Object.keys(i).length;if(!f||!r)return;Notification.permission==="granted"?o(i):Notification.requestPermission().then(t=>{t==="granted"&&o(i)});function o({title:t,body:s,icon:c}){new Notification(t,{body:s,icon:c})}})}var p=n;export{p as default};