# qwark

> The simplest React global state

Latest version **1.0.10** (published 2023-03-11) · ISC license · 0 weekly downloads

## Install

```sh
npm install qwark
pnpm add qwark
yarn add qwark
bun add qwark
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.10 |
| Published | 2023-03-11 |
| First published | 2023-03-07 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 2.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Dinislam Maushov |
| Maintainers | hyposlasher |
| Keywords | qwark, quark, react, global, state, atom |

## Links

- npm: https://www.npmjs.com/package/qwark
- Repository: https://github.com/hyposlasher/qwark
- Homepage: https://github.com/hyposlasher/qwark#readme
- Issues: https://github.com/hyposlasher/qwark/issues
- npm.io page: https://npm.io/package/qwark

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.0.10 (latest) — 2023-03-11
- 1.0.9 — 2023-03-11
- 1.0.8 — 2023-03-11
- 1.0.7 — 2023-03-10
- 1.0.4 — 2023-03-08
- 1.0.3 — 2023-03-08
- 1.0.2 — 2023-03-08
- 1.0.1 — 2023-03-08
- 1.0.0 — 2023-03-07

## README

# the simpliest way to make `useState` global
[Demo](https://codesandbox.io/s/qwark-demo-5ohe7g)

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

## Installation

```bash
npm install qwark
```

or yarn:

```bash
yarn add qwark
```

## Usage
### Create qwark hook
```javascript
import qwark from "qwark";

const useCountQwark = qwark(0); // call with initial state
```
### Use the created qwark hook in any React component
``` javascript
const Button = () => {
  const [count, setCount] = useCountQwark();

  return <button onClick={() => setCount(count + 1)}>Increment</button>;
};
```

``` javascript
const Count = () => {
  const [count] = useCountQwark();

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

---
_Source: https://npm.io/package/qwark · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
