# @tory.ir/react-atomic

> An atomic state manager just like recoil.

Latest version **1.0.7** (published 2022-11-29) · UNLICENSED license · 0 weekly downloads

## Install

```sh
npm install @tory.ir/react-atomic
pnpm add @tory.ir/react-atomic
yarn add @tory.ir/react-atomic
bun add @tory.ir/react-atomic
```

## Health

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

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.7 |
| Published | 2022-11-29 |
| First published | 2022-11-29 |
| Weekly downloads | 0 |
| License | UNLICENSED |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 14.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Maintainers | kordeviant |

## Links

- npm: https://www.npmjs.com/package/@tory.ir/react-atomic
- Repository: https://github.com/kordeviant/react-atomic-state
- Homepage: https://github.com/kordeviant/react-atomic-state#readme
- Issues: https://github.com/kordeviant/react-atomic-state/issues
- npm.io page: https://npm.io/package/@tory.ir/react-atomic

## Recent versions

- 1.0.7 (latest) — 2022-11-29
- 1.0.6 — 2022-11-29
- 1.0.5 — 2022-11-29
- 1.0.4 — 2022-11-29
- 1.0.3 — 2022-11-29
- 1.0.2 — 2022-11-29
- 1.0.1 — 2022-11-29
- 1.1.4 — 2022-11-29
- 1.1.3 — 2022-11-29

## README

# @tory.ir/react-atomic

An atomic state manager just like recoil.

In under 100 lines of code, plain and simple.

Without the need to have a context provider in component tree.

With selector functions rerendering only if the selected value is changed.

`npm i @tory.ir/react-atomic `

## demo

[sandbox demo](https://codesandbox.io/s/tory-ir-react-atomic-s43ms1?file=/src/App.tsx)

```
export const stateAtom = new Atom({ a: 1, b: 1 });

// inside component
    const setState = useAtomSetState(stateAtom);
// or
    const state = useAtomValue(stateAtom);
// or
    const selectedState = useAtomSelectValue(stateAtom,(x) => x.a);
// or
    const [state,setState] = useAtomState(stateAtom);
```

made with ❤️

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