1.1.0 ā¢ Published 3 years ago
potli v1.1.0
š Homepage
Why?
A super lightweight state management library, that uses Context API and AsyncStorage(local storage for web) behind the scenes to:
- Provide an extremely easy to use API.
- Retain state even after app kills or browser restarts.
- Maintains state app-wide, update your value for a key in one screen and it gets updated in the whole app.
Install
npm i potli
Usage
1. Wrap your app in Store from potli/Store
import Store from 'potli/Store'
...
const App = () => {
...
return (
<Store>
// Your app
<Store>
);
}
2. Use Anywhere in your app
import Store from 'potli/useStore'
...
const SomeComponent = () => {
...
const {data, setData} = useStore('USER')
...
}
Author
š¤ seven
- Github: @sanu23kumar
Show your support
Give a āļø if this project helped you!
š License
Copyright Ā© 2021 seven.