npm install js-flash-message --save
import Flash from 'js-flash-message'
Flash.create({type: 'success', message: 'Hello World!'});
The create method accepts only 1 parameter which is of type object. Flash will not be set if an empty object is passed.
const flashes = Flash.get()
This method will return an Array of objects containing all the flash messages set. Once received Flash messages will be flushed.