Basic toast component for marionette
Simply pass in an initialization option object with an optional className (To provide custom styling)
import Toast from "@vokke/toast";
this.toast = new Toast({
className: "helloWorld"
});Showing the toast, you just call .show() on it
this.toast.show({
message: "Hello world",
timeout: 4500
});The only event so far is a click on the whole toast, To bind to this, use the following.
this.listenTo(this.toast, "click:toast", e => {
console.log(e);
});
// or
this.toast.on("click:toast", e => {
console.log(e);
});- Setup the build process