// retoor <retoor@molodetz.nl>

export class Toast {
    static flash(element, message, ms = 2000, revertTo = null) {
        const original = revertTo === null ? element.textContent : revertTo;
        element.textContent = message;
        setTimeout(() => {
            if (element.textContent === message) {
                element.textContent = original;
            }
        }, ms);
    }
}

window.Toast = Toast;
