SkillAgentSearch skills...

UseDebug

Custom hook to debug useEffect

Install / Use

/learn @siddharthkp/UseDebug
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

<p align="center"> <img src="https://octodex.github.com/images/daftpunktocat-guy.gif" height="200px"/> <br><br> <b>Custom hook to debug useEffect</b> <br><br> <a href="https://codesandbox.io/s/0qqmmv251w?moduleview=1"/>Codesandbox demo 🔗</a> </p>

 

Based on Tomasz Łakomy's egghead lesson on hooks

 

install

Uses the useEffect hook from React 16.7+

npm install usedebug

 

usage

import React from "react"
const useDebug = require("usedebug")

function MyComponent() {
  useDebug("mycomponent") // call useDebug with an optional id
  return <div>Hey!</div>
}

Check the console to see logs

__DEBUG_mycomponent__ mounted 
__DEBUG_mycomponent__ unmounted

 

like it?

:star: this repo

 

license

MIT © siddharthkp

View on GitHub
GitHub Stars21
CategoryDevelopment
Updated5y ago
Forks5

Languages

JavaScript

Security Score

75/100

Audited on Nov 11, 2020

No findings