You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
595 B
24 lines
595 B
2 years ago
|
import {EventBus} from './EventBus.service.js'
|
||
|
|
||
|
export class Message {
|
||
|
static get() {
|
||
|
if ( !this.instance ) {
|
||
|
this.instance = new Message()
|
||
|
}
|
||
|
|
||
|
return this.instance
|
||
|
}
|
||
|
|
||
|
alert({ type, message, timeout = 0, onDismiss = () => {} }) {
|
||
|
return EventBus.get()
|
||
|
.event('message.alert')
|
||
|
.fire({ type, message, timeout, onDismiss })
|
||
|
}
|
||
|
|
||
|
modal({ title, message, buttons = [], inputs = [] }) {
|
||
|
return EventBus.get()
|
||
|
.event('message.modal')
|
||
|
.fire({ title, message, buttons, inputs })
|
||
|
}
|
||
|
}
|