jotai-tiny
TypeScript icon, indicating that this package has built-in type declarations

0.1.3 • Public • Published

jotai-tiny

Reactjs State Manager with no dependencies

npm version npm npm All Contributors

Demo

Demo

Installation

NPM

Require

react >= 18

To install the latest stable version:

npm install --save jotai-tiny

Basic usage:

import { atom, useAtom, useAtomValue } from "jotai-tiny";

const atomCount = atom(0);
const atomCount1 = atom(1);

// const totalCountAtom = atom((get) => get(atomCount) + get(atomCount1));
// const dataAtom = atom(() => fetch("/data.json").then((res) => res.json()));

const App = () => {
  const [count, setCount] = useAtom(atomCount)

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

Package Sidebar

Install

npm i jotai-tiny

Weekly Downloads

3

Version

0.1.3

License

MIT

Unpacked Size

59.8 kB

Total Files

12

Last publish

Collaborators

  • hunghg255