Licence
ISC
Version
0.0.2
Deps
2
Size
5 kB
Vulns
0
Weekly
0
Neat-state
Usage
- set a state to the global store
import { neat } from 'neat-state'
const myValueNeat = neat(100)
- get a value from the global store
import { neat } from 'neat-state'
const getMyValueNeat = neat((get) => get(myValue))
- get a value from promise
import { neat } from 'neat-state'
const promiseDataNeat = neat(() => fetch('url-data').then((res) => res.json()))
- use store within components
import { useNeat } from 'neat-state'
const [myValue, setMyValue] = useNeat(myValueNeat)
<>{myValue}</>