add notifications
This commit is contained in:
16
src/components/Notifications/notificationContext.js
Normal file
16
src/components/Notifications/notificationContext.js
Normal file
@@ -0,0 +1,16 @@
|
||||
import { reactive } from "vue";
|
||||
|
||||
export const notifications = reactive({});
|
||||
|
||||
export const addNotification = (id, title, message, type, lifeTime = 0) => {
|
||||
notifications[id] = {
|
||||
title,
|
||||
message,
|
||||
type,
|
||||
lifeTime,
|
||||
};
|
||||
};
|
||||
|
||||
export const deleteNotification = (id) => {
|
||||
delete notifications[id];
|
||||
};
|
||||
Reference in New Issue
Block a user