/ Basic nuxt setup (some areas still broken)
This commit is contained in:
23
full-skies-nuxt/store/toasts/index.js
Normal file
23
full-skies-nuxt/store/toasts/index.js
Normal file
@@ -0,0 +1,23 @@
|
||||
export default {
|
||||
state: () => {
|
||||
return {
|
||||
queue: []
|
||||
}
|
||||
},
|
||||
mutations: {
|
||||
pushToast: (state, toast) => {
|
||||
state.queue.push(toast)
|
||||
},
|
||||
purgeToast: (state, toastId) => {
|
||||
state.queue = state.queue.filter(toast => toast.id !== toastId)
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
pushToast: ({ commit }, toast) => {
|
||||
commit('pushToast', toast)
|
||||
},
|
||||
purgeToast: ({ commit }, toastId) => {
|
||||
commit('purgeToast', toastId)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user