open-vault/ui/app/helpers/set-flash-message.js

13 lines
284 B
JavaScript
Raw Normal View History

import { inject as service } from '@ember/service';
import Helper from '@ember/component/helper';
2018-04-03 14:16:57 +00:00
export default Helper.extend({
flashMessages: service(),
2018-04-03 14:16:57 +00:00
compute([message, type]) {
return () => {
this.get('flashMessages')[type || 'success'](message);
};
},
});