diff options
| author | Fuwn <[email protected]> | 2026-03-01 16:20:51 -0800 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2026-03-01 16:21:02 -0800 |
| commit | eae5d24d9e79e59a19d4721caaeaa0ca650ecb33 (patch) | |
| tree | 1b685bb248e051dfa26d2bfdebe6689402dd93c5 /src/lib/Notification/store.ts | |
| parent | chore(tooling): remove legacy eslint and prettier (diff) | |
| download | due.moe-eae5d24d9e79e59a19d4721caaeaa0ca650ecb33.tar.xz due.moe-eae5d24d9e79e59a19d4721caaeaa0ca650ecb33.zip | |
chore(biome): drop formatter style overrides
Diffstat (limited to 'src/lib/Notification/store.ts')
| -rw-r--r-- | src/lib/Notification/store.ts | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/src/lib/Notification/store.ts b/src/lib/Notification/store.ts index 0cb4cf96..4eb163f9 100644 --- a/src/lib/Notification/store.ts +++ b/src/lib/Notification/store.ts @@ -1,32 +1,32 @@ -import { writable } from 'svelte/store'; +import { writable } from "svelte/store"; export interface Notification { - id: string; - heading: string; - description?: string; - duration?: number; + id: string; + heading: string; + description?: string; + duration?: number; } function createNotificationStore() { - const { subscribe, update } = writable<Notification[]>([]); + const { subscribe, update } = writable<Notification[]>([]); - return { - subscribe, - add: (notification: Omit<Notification, 'id'>) => { - const id = crypto.randomUUID(); + return { + subscribe, + add: (notification: Omit<Notification, "id">) => { + const id = crypto.randomUUID(); - update((notifications) => [...notifications, { ...notification, id }]); + update((notifications) => [...notifications, { ...notification, id }]); - return id; - }, - remove: (id: string) => { - update((notifications) => notifications.filter((n) => n.id !== id)); - } - }; + return id; + }, + remove: (id: string) => { + update((notifications) => notifications.filter((n) => n.id !== id)); + }, + }; } export const notifications = createNotificationStore(); -export function addNotification(notification: Omit<Notification, 'id'>) { - return notifications.add(notification); +export function addNotification(notification: Omit<Notification, "id">) { + return notifications.add(notification); } |