project map script | semantic parcer
This commit is contained in:
@@ -8,6 +8,7 @@ import { writable } from 'svelte/store';
|
||||
// [DEF:toasts:Data]
|
||||
// @PURPOSE: Writable store containing the list of active toasts.
|
||||
export const toasts = writable([]);
|
||||
// [/DEF:toasts:Data]
|
||||
|
||||
// [DEF:addToast:Function]
|
||||
// @PURPOSE: Adds a new toast message.
|
||||
@@ -20,7 +21,7 @@ export function addToast(message, type = 'info', duration = 3000) {
|
||||
toasts.update(all => [...all, { id, message, type }]);
|
||||
setTimeout(() => removeToast(id), duration);
|
||||
}
|
||||
// [/DEF:addToast]
|
||||
// [/DEF:addToast:Function]
|
||||
|
||||
// [DEF:removeToast:Function]
|
||||
// @PURPOSE: Removes a toast message by ID.
|
||||
@@ -29,5 +30,5 @@ function removeToast(id) {
|
||||
console.log(`[toasts.removeToast][Action] Removing toast context={{'id': '${id}'}}`);
|
||||
toasts.update(all => all.filter(t => t.id !== id));
|
||||
}
|
||||
// [/DEF:removeToast]
|
||||
// [/DEF:toasts_module]
|
||||
// [/DEF:removeToast:Function]
|
||||
// [/DEF:toasts_module:Module]
|
||||
Reference in New Issue
Block a user