mirror of
https://github.com/nolanlawson/pinafore
synced 2024-12-11 09:45:24 +01:00
19 lines
309 B
JavaScript
19 lines
309 B
JavaScript
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: () => {}
|
|
}
|
|
}
|
|
|
|
export { toast }
|