import {alert, pageState} from "~/types/interfaces"; export const state = () => ({ alerts: [] }) export const mutations = { setAlert(state:pageState, alert:alert){ state.alerts.push(alert) }, removeAlert(state:pageState){ state.alerts.shift() } } export const actions = { removeSlowlyAlert(context:any){ setTimeout(()=>{ context.commit('removeAlert') }, 300) } }