pinafore/src/routes/_utils/toast.js

19 lines
309 B
JavaScript
Raw Normal View History

import Toast from '../_components/Toast.html'
let toast
if (process.browser) {
toast = new Toast({
target: document.querySelector('#toast')
})
if (process.env.NODE_ENV !== 'production') {
window.toast = toast // for debugging
}
} else {
toast = {
say: () => {}
}
}
2018-02-09 07:29:29 +01:00
export { toast }