2.0.6 • Published 4 years ago

@bscop/use-did-mount v2.0.6

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

@bscop/use-did-mount

GitHub license npm version CircleCI Status Coverage

React hook to handle componentDidMount, and componentWillUnmount lifecycle events.

Install

npm i @bscop/use-did-mount

Usage

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");
    }
  },
);

Contribute

Read the guidelines.

Run tests

npm test

Coverage

Coverage reports are hosted on codecov.

npm run badge:coverage -- --token=<guid>

Bruno Scopelliti\ www.brunoscopelliti.com