Go to file
Auri ef366c878b 0.3.0 2022-03-17 10:00:07 -07:00
.github Create FUNDING.yml 2021-08-07 02:05:33 -07:00
dist Fix useStoredState when undefined is returned. 2022-02-10 15:00:26 -08:00
src - useInlineEffect - Calls an effect immediately. 2022-03-17 09:59:33 -07:00
.eslintrc.json Fix useStoredState when undefined is returned. 2022-02-10 15:00:26 -08:00
.gitignore Add dist with package.json 2021-08-07 01:57:05 -07:00
.prettierrc Fix useStoredState when undefined is returned. 2022-02-10 15:00:26 -08:00
LICENSE.md Rename LICENSE to LICENSE.md 2021-08-07 01:54:17 -07:00
README.md Update README.md 2021-08-07 02:02:39 -07:00
package-lock.json 0.3.0 2022-03-17 10:00:07 -07:00
package.json 0.3.0 2022-03-17 10:00:07 -07:00
tsconfig.json Add source 2021-08-07 01:56:20 -07:00
webpack.ts Fix useStoredState when undefined is returned. 2022-02-10 15:00:26 -08:00

README.md

Absolutely Vibin' Hooks for (P)React.

Okay, but what is this, anyways?

I've been working on a lot of React projects recently, and I seem to run into the need for the same hooks again and again. So I thought: 'why not make this simpler and just publish a package with all of them in it?' And now we're here. All of them are compatible with React and Preact, and the package has its own typings, because I'm not a troglodyte.

What hooks are included?

View the source for the full documentation, but a basic list are as follows:

  • useAsyncEffect - Calls an effect asynchronously, with aborting.
  • useAsyncMemo - Memoizes an asynchronous value, with caching, defaults, and aborting.
  • useMediaMatches - Checks a media query using window.matchMedia.
  • useMessaging - Event-based cross-origin message sharing.
  • useRerender - Returns a memoized callback that makes the component rerender.
  • useStoredState - A useState that caches the state value in the local storage.

Why "Vibin'"?

I don't know man, it's 2:00 AM.