use-mounted
v0.0.2
Published
mounted hook that allows to return promises
Downloads
9
Maintainers
Readme
npm install use-mounted
Converts
useEffect(() => {
const fetchData = async () => {
// await fetch('endpoint')
}
fetchData()
}, [])to
import useMounted from 'use-mounted'
useMounted(async () => {
// await fetch('endpoint')
})