Skip to content

A React hook to keep a watch on the changing props or state variables of a React component/hook.

Notifications You must be signed in to change notification settings

paramsinghvc/vigilante

Repository files navigation

@mollycule/vigilante

A React hook to keep a watch on the changing props or state variables of a React component/hook.

NPM Build Status MIT License Contributors LinkedIn


Logo

useVigilante React Hook

React hook to keep a watch on the changing props or state variables of a React component/hook.
Explore the docs »

View Demo · Report Bug · Request Feature . NPM Link

Table of Contents

About The Project

useVigilante is a simple plug and play React hook to keep a watch on the changing props or state variables of a React component/hook.

useVigilante('Weather Component', { latLong, weatherData, getWeather })

It gives the console output as below whenever any change in the listed variables happen in the given component or hook. Logo

Built With

Getting Started

Prerequisites

Following Peer Dependencies are required for using useVigilante package:

  • react: "^16.0.0"

Install

npm install --save @mollycule/vigilante

yarn add @mollycule/vigilante

Usage

useVigilante(<Component or Hook Name>, { <prop1>, <state1>, <prop2>, ...  })

Detailed Usage

import React, { useEffect } from 'react'

import useVigilante from '@mollycule/vigilante'

const WeatherComp = () => {
  const latLong = useGeoLocation()
  const { getWeather, weatherData } = useWeather()

  useVigilante('Weather Component', { latLong, weatherData, getWeather })

  useEffect(() => {
    getWeather(latLong);
  }, [getWeather, latLong])

  return (
    <Holder>
      {...}
    </Holder>
  )
}

License

MIT © paramsinghvc

Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature)
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the MIT License. See LICENSE for more information.

Contact

Param Singh - @paramsinghvc - paramsinghvc@gmail.com

Project Link: https://github.com/paramsinghvc/vigilante

Acknowledgements

About

A React hook to keep a watch on the changing props or state variables of a React component/hook.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published