1.0.10 • Published 1 year ago

qwark v1.0.10

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

the simpliest way to make useState global

Demo

qwark creates a global useState hook. No Context. No Providers. With useState-like API

Installation

npm install qwark

or yarn:

yarn add qwark

Usage

Create qwark hook

import qwark from "qwark";

const useCountQwark = qwark(0); // call with initial state

Use the created qwark hook in any React component

const Button = () => {
  const [count, setCount] = useCountQwark();

  return <button onClick={() => setCount(count + 1)}>Increment</button>;
};
const Count = () => {
  const [count] = useCountQwark();

  return <p>{count}</p>;
};
1.0.10

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago