Skip to content

The library that makes the most popular or complex functions into simple hooks for daily use

License

Notifications You must be signed in to change notification settings

Mario-aj/custom-hooks

Repository files navigation

custom-hooks

The library that makes the most popular or complex functions into simple hooks for daily use


Include popular hooks in your React projects easily with custom-hooks, with ES6 features that allows you to include only the hooks you want.

Installation

Note: This library is still in development, was not published to npm.

Usage

We have several examples on the hooks page. Here is the first one to get you started:

import { useRecognition } from 'custom-hooks';

const App = () => {
  const [{ transcript, listening }, recognition] = useRecognition({
    language: 'pt-BR',
  });

  const startSpeech = () => {
    try {
      listening ? recognition.stop() : recognition.start();
    } catch (error) {
      console.log(error.message);
    }
  };

  return (
    <>
      <button onClick={startSpeech}>start speech</button>
      {transcript && <span>{transcript}</span>}
    </>
  );
};

Contributing

We'd love to have your helping hand on custom-hooks! See CONTRIBUTING.md for more information on what we're looking for and how to get started.

licence-icon License

Custom-hooks is MIT licensed.

✍🏻 Creator

Mário Alfredo Jorge

About

The library that makes the most popular or complex functions into simple hooks for daily use

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published