use-react-store
v0.0.5
Published
```javascript
Downloads
1
Readme
demo
import {useEffect} from "react";
import './App.css'
import {setStorageValue, useStorageValue} from "../lib";
function App() {
useEffect(()=>{
setStorageValue("test", "count",{aa:999});
},[])
const count = useStorageValue("test", "count.aa") || 0;
const setNextCount = () => {
setStorageValue("test", "count.aa", count + 1);
}
return (
<div className="App">
<button onClick={() => setNextCount()}>
count is {count}
</button>
</div>
)
}
export default App