+ Added old store (that doesn't work yet)
This commit is contained in:
27
full-skies-nuxt/store/toasts.js
Normal file
27
full-skies-nuxt/store/toasts.js
Normal file
@@ -0,0 +1,27 @@
|
||||
export const state = () => ({
|
||||
queue: []
|
||||
})
|
||||
|
||||
export const mutations = {
|
||||
pushToast: (state, toast) => {
|
||||
state.queue.push(toast)
|
||||
},
|
||||
purgeToast: (state, toastId) => {
|
||||
state.queue = state.queue.filter(toast => toast.id !== toastId)
|
||||
}
|
||||
}
|
||||
|
||||
export const actions = {
|
||||
pushToast: ({ commit }, toast) => {
|
||||
commit('pushToast', toast)
|
||||
},
|
||||
purgeToast: ({ commit }, toastId) => {
|
||||
commit('purgeToast', toastId)
|
||||
}
|
||||
}
|
||||
|
||||
export default {
|
||||
state,
|
||||
mutations,
|
||||
actions
|
||||
}
|
||||
Reference in New Issue
Block a user