misc_pterodactyl-panel/resources/scripts/state/models/flashes.ts
2019-06-22 23:45:09 -07:00

14 lines
389 B
TypeScript

import { action } from 'easy-peasy';
import { FlashState } from '@/state/types';
const flashes: FlashState = {
items: [],
addFlash: action((state, payload) => {
state.items.push(payload);
}),
clearFlashes: action((state, payload) => {
state.items = payload ? state.items.filter(flashes => flashes.key !== payload) : [];
}),
};
export default flashes;