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.
49 lines
727 B
49 lines
727 B
import observable from '@riotjs/observable'
|
|
|
|
/**
|
|
* NotificationService
|
|
*
|
|
*
|
|
*/
|
|
export default observable({
|
|
|
|
SUCCESS: 'success',
|
|
DANGER: 'danger',
|
|
INFO: 'info',
|
|
|
|
/**
|
|
*
|
|
*
|
|
*/
|
|
success(message) {
|
|
this._add(message, this.SUCCESS)
|
|
},
|
|
|
|
/**
|
|
*
|
|
*
|
|
*/
|
|
danger(message) {
|
|
this._add(message, this.DANGER)
|
|
},
|
|
|
|
/**
|
|
*
|
|
*
|
|
*/
|
|
info(message) {
|
|
this._add(message, this.INFO)
|
|
},
|
|
|
|
/**
|
|
*
|
|
* @param {[type]} message [description]
|
|
* @param {[type]} type [description]
|
|
*/
|
|
_add(message, type) {
|
|
this.trigger('update', {
|
|
message: message,
|
|
type: type
|
|
})
|
|
}
|
|
}) |