Skip to content

Instantly share code, notes, and snippets.

@pogilvie
Last active April 30, 2018 04:46
Show Gist options
  • Save pogilvie/315f8e7bba18501cb785ce64ff1af2f1 to your computer and use it in GitHub Desktop.
Save pogilvie/315f8e7bba18501cb785ce64ff1af2f1 to your computer and use it in GitHub Desktop.

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()
    }
   
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment