feat: integrate SvelteKit for seamless navigation and improved data loading
This commit is contained in:
16
frontend/.svelte-kit/output/server/chunks/toasts.js
Normal file
16
frontend/.svelte-kit/output/server/chunks/toasts.js
Normal file
@@ -0,0 +1,16 @@
|
||||
import { w as writable } from "./index.js";
|
||||
const toasts = writable([]);
|
||||
function addToast(message, type = "info", duration = 3e3) {
|
||||
const id = Math.random().toString(36).substr(2, 9);
|
||||
console.log(`[toasts.addToast][Action] Adding toast context={{'id': '${id}', 'type': '${type}', 'message': '${message}'}}`);
|
||||
toasts.update((all) => [...all, { id, message, type }]);
|
||||
setTimeout(() => removeToast(id), duration);
|
||||
}
|
||||
function removeToast(id) {
|
||||
console.log(`[toasts.removeToast][Action] Removing toast context={{'id': '${id}'}}`);
|
||||
toasts.update((all) => all.filter((t) => t.id !== id));
|
||||
}
|
||||
export {
|
||||
addToast as a,
|
||||
toasts as t
|
||||
};
|
||||
Reference in New Issue
Block a user