Helper function to make firing Toast messages easy in lightning components.
({
// utility to pop up a toast msg easily
// type is 'error', 'warning', 'success', or 'info'
toast: function (type, title, msg) {
let t = $A.get('e.force:showToast')
t.setParams({type: type, title: title, message: msg})
t.fire()
}
})