React hook to handle componentDidMount, and componentWillUnmount lifecycle events.
@bscop/use-did-mount"">
React hook to handle componentDidMount, and componentWillUnmount lifecycle events.
npm i @bscop/use-did-mount
import useDidMount from "@bscop/use-did-mount";
useDidMount(
function onMount () {
console.log("Yay, component is mounted");
return function onUnmount () {
console.log("Yay, component is unmounted");
}
},
);
Read the guidelines.
npm test
Coverage reports are hosted on codecov.
npm run badge:coverage -- --token=<guid>
Bruno Scopelliti\
www.brunoscopelliti.com