useeffectlogger

1.0.5 • Public • Published

useEffectLogger

Link to NPM

This is a custom React hook that is a drop in replacement for the useEffect hook. It will log the index of the variable that triggered the hook, the before and after value of the variable in a table.

npm i useeffectlogger

import useEffectLogger from 'useEffectLogger'
  //change useEffect to useEffectLogger
  
  // useEffect(()=>{
  // },[user,password])
  
  useEffectLogger(()=>{
  },[user,password])

This will be logged in the console when the user variable has changed in the above example.

(index) before after
0 "usernam" "username"

Package Sidebar

Install

npm i useeffectlogger

Weekly Downloads

5

Version

1.0.5

License

ISC

Unpacked Size

2.61 kB

Total Files

3

Last publish

Collaborators

  • brycemclachlan