1- # <p align =" center " >BitAboutState</p >
21<p align =" center " >
3- <img alt =" " src =" https://user-images.githubusercontent.com/1496580/160495578-c4a54e53-7c5f-4bc3-9db3-a45c6ed45394 .png " /><br />
2+ <img alt =" " src =" https://user-images.githubusercontent.com/1496580/162103874-f2fbde4b-f985-4c33-ac38-9d5d3b4ee37e .png " />< br /><br />
43<a href =" https://www.npmjs.com/package/@bit-about/state " ><img alt =" " src =" https://img.shields.io/npm/v/@bit-about/state.svg " /></a >
54<img alt =" Bundle size " src =" https://img.shields.io/bundlephobia/min/@bit-about/state?label=size " />
6- <a href =" https://codecov.io/gh/bit-about/state " ><img alt =" " src =" https://codecov.io/gh/bit-about/state/branch/main/graph/badge.svg?token=BuGi92VqnL " /></a >
7- <br />
8- 🚀 Tiny and powerful React hook-based state management library.<br />
9- 100% Idiomatic React.<br />
5+ <a href =" https://codecov.io/gh/bit-about/state " ><img alt =" " src =" https://img.shields.io/codecov/c/github/bit-about/state?token=BuGi92VqnL " />
106</p >
117
128## Install
139
1410``` bash
15- npm install --save @bit-about/state
11+ npm i @bit-about/state
1612```
1713
1814## Features
@@ -23,7 +19,7 @@ npm install --save @bit-about/state
2319- State on hook
2420- ...with static access
2521- No centralized state provider
26- - Tiny - only ** 100KB **
22+ - Tiny - only ** 2.6kB **
2723- ** Just works** ™
2824
2925## Usage
@@ -171,12 +167,10 @@ const [UserProvider, useUser] = state(
171167
172168``` tsx
173169import { useQuery } from ' react-query'
174- import { fetchUser } from ' ./user.ts'
175-
176- type UserProfileHookProps = { id: number }
170+ import { fetchUser } from ' ./user'
177171
178172const [UserProvider, useUser] = state (
179- ({ id }: UserProfileHookProps ) => {
173+ ({ id }) => {
180174 const { data : user } = useQuery ([' user' , id ], () => fetchUser (id ))
181175 return { user }
182176 }
0 commit comments