Files
yt-dlp-webui/frontend/src/atoms/ui.ts
2024-11-12 11:31:25 +01:00

10 lines
286 B
TypeScript

import { atom } from 'jotai'
import { activeDownloadsState } from './downloads'
export const loadingAtom = atom(true)
export const totalDownloadSpeedState = atom<number>((get) =>
get(activeDownloadsState)
.map(d => d.progress.speed)
.reduce((curr, next) => curr + next, 0)
)