Retrospring/app/javascript/retrospring/controllers/toast_controller.ts

18 lines
430 B
TypeScript
Raw Normal View History

2023-02-10 21:16:42 -08:00
import { Controller } from '@hotwired/stimulus';
import { showNotification } from "utilities/notifications";
export default class extends Controller<HTMLElement> {
static values = {
message: String,
success: Boolean
};
declare readonly messageValue: string;
declare readonly successValue: boolean;
connect(): void {
showNotification(this.messageValue, this.successValue);
this.element.remove();
}
}