You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
spa_instat_tv/src/features/MultiSourcePlayer/hooks/useDuration.tsx

9 lines
221 B

import { useMemo } from 'react'
import sumBy from 'lodash/sumBy'
import type { Chapters } from '../types'
export const useDuration = (chapters: Chapters) => (
useMemo(() => sumBy(chapters, 'duration'), [chapters])
)