项目作者: brunoscopelliti

项目描述 :
React hook to handle componentDidMount, and componentWillUnmount lifecycle events.
高级语言: JavaScript
项目地址: git://github.com/brunoscopelliti/use-did-mount.git
创建时间: 2021-04-29T20:18:43Z
项目社区:https://github.com/brunoscopelliti/use-did-mount

开源协议:MIT License

下载


@bscop/use-did-mount

GitHub license
@bscop/use-did-mount"">npm version
CircleCI Status
Coverage

React hook to handle componentDidMount, and componentWillUnmount lifecycle events.

Install

  1. npm i @bscop/use-did-mount

Usage

  1. import useDidMount from "@bscop/use-did-mount";
  2. useDidMount(
  3. function onMount () {
  4. console.log("Yay, component is mounted");
  5. return function onUnmount () {
  6. console.log("Yay, component is unmounted");
  7. }
  8. },
  9. );

Contribute

Read the guidelines.

Run tests

  1. npm test

Coverage

Coverage reports are hosted on codecov.

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

Bruno Scopelliti\
www.brunoscopelliti.com