13 lines
276 B
TypeScript
13 lines
276 B
TypeScript
|
import { useEffect, useState } from 'react'
|
||
|
import isNetworkSlow from 'utils/network'
|
||
|
|
||
|
export default function useNetworkSpeed() {
|
||
|
const [slowNetwork, setSlowNetwork] = useState(true)
|
||
|
|
||
|
useEffect(() => {
|
||
|
setSlowNetwork(isNetworkSlow())
|
||
|
}, [])
|
||
|
|
||
|
return slowNetwork
|
||
|
}
|