fix: Fix lint errors (#559)
* cleanup: postactions styling * misc: fix first round of errors * pkg: remove vitest * fix: fix lint errors stage 2 * fix: fix lint errors stage 3 * fix: fix lint errors, stage 3 * misc: update eslint rules to warn for writable derived
This commit is contained in:
1 parent
1824245f13
commit
76c581123a
225 files changed
+1553
-2352
No files matched your search
@@ -18,7 +18,7 @@ export interface Toast {
|
||||
content: string
|
||||
type: ToastType
|
||||
loading?: boolean
|
||||
action?: () => any
|
||||
action?: () => void
|
||||
}
|
||||
|
||||
export const toasts = writable<Toast[]>([])
|
||||
@@ -36,11 +36,11 @@ export function toast({
|
||||
type?: ToastType
|
||||
duration?: number
|
||||
loading?: boolean
|
||||
action?: () => any
|
||||
action?: () => void
|
||||
}) {
|
||||
let id = 0
|
||||
|
||||
toasts.update((toasts) => {
|
||||
toasts.update(toasts => {
|
||||
id = Math.floor(Math.random() * 10000)
|
||||
|
||||
return [
|
||||
@@ -57,11 +57,11 @@ export function toast({
|
||||
})
|
||||
|
||||
setTimeout(() => {
|
||||
toasts.update((toasts) => toasts.filter((toast) => toast.id != id))
|
||||
toasts.update(toasts => toasts.filter(toast => toast.id != id))
|
||||
}, duration)
|
||||
|
||||
return id
|
||||
}
|
||||
|
||||
export const removeToast = (id: number) =>
|
||||
toasts.update((toasts) => toasts.filter((toast) => toast.id != id))
|
||||
toasts.update(toasts => toasts.filter(toast => toast.id != id))
|
||||
Reference in new issue
Block a user