Giter Club home page Giter Club logo

usecustomhooks's Issues

Need useQueue Hook

Describe the hook

Since the package already contains a useStack hook, it would be great to have a useQueue hook.

  • This hook will be similar to useStack but for Queue data structure.

PRs are welcome ๐Ÿ™‚

Add useMousePointer hook

Describe the hook

A hook which returns the current coordinates of the mouse pointer, as a state.

Need Issue & Pull request templates.

Issue Description

The repo currently has 2 templates for issues, but it lacks an issue template for general issues and documentation issues.

Possible Solution

Add templates for PRs and Issues. Also, suggest improvements for the current issue templates.

Documentation is not complete

What is the Problem?

The documentation for the hooks are not complete. Only useLocalStorage hook has complete documentation. Other hooks does not contain Parameters and Return values in their documentation

Possible Solution

Add parameters and return values to the docs of all other hooks

What to contribute? How can you help?

  • The code for each hook contains corresponding parameters and return values, defined as JSdoc comments.
  • You can take the data from there and add it to the documentation

Move the documentation for the custom hooks from README

Issue Description

Currently, the documentation for every hooks are added to the README file. This can get complex as the number of hooks in the package increases.

Possible Solution

We should move these to a new location. A separate doc section would help. Please share your suggestion on how to solve this.

Include useDarkMode hook

Describe the hook

A hook which will return a dark state and set dark state function.
The hook should add a class name to the body when dark mode.

Example

import {useDarkMode} from "useDarkMode"

const App = () =>{

 const [darkMode,setDarkMode] = useDarkMode(true,"dark")
 //This should add a class name .dark to the body if it is dark mode.

 return <div></div>
}

Hook to get the latitude and longitude

Describe the hook
A hook to get the latitude and longitude

Additional context
Create a hook to get the current position from the browser.

import React from "react"
import useGeolocalisation from "useGeolocalisation"

const Home = () => {
  /*
  * The hook will return you an object like this: 
  * 
  * {
  *   latitude: 1233234,
  *   longitude: -1234345,
  * }
  * 
  */

  const [geolocalitation] = useGeolocalisation(true);

  return (
    <div>
      {geolocalitation.latitude}
      {geolocalitation.longitude}
    </div>
  );
}

import issue

I am getting an invalid hook call error, can anyone help me to solve this!

error

error

code

code

but when I am using it as a separate file, it works

example

image

Request for useToggle hook

Describe the hook

A hook which will return a boolean state and a toggle function.
The toggle function should set the state to its negation.

๐ŸŒŸ Add new custom hooks !

Description

Need to add more custom hooks to this repo.

For Contributors

  • Please include an example of how the hook is used.
  • Add JSDoc comments to the hook to get IntelliSense for the hook.
  • Also consider adding your hook to the Readme file.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.