@lumberyard/chipper
v1.1.1
Published
A minimalistic state-management tool for your megalomaniac React needs
Downloads
23
Maintainers
Readme
Chipper
A minimalistic state-management tool for your megalomaniac React needs.
Note: Chipper is a work in progress
Wat?
- minimal setup
- written with TS
- no excess re-renders
- react and react-native friendly
- immer is used somewhere inside (easier that way)
- you can access state from outside of React components
- built-in capabilities for handling status of async functions
How?
In the terminal
yarn add @lumberyard/chipper
// or
npm install @lumberyard/chipper
In the code
import Chipper, { useChip } from "@lumberyard/chipper";
Chipper.loadChips([
["user", { uid: "12345", name: "piglet" }],
["theme", { dark: true, color: "pink" }],
]);
const MyComponent = () => {
const { data, status, set } = useChip('user');
set((user) => {
user.name = 'pooh';
});
return (...)
}
And that's pretty much it. Congratulations, you just spent 10 seconds setting up your global state. Time well spent, now go, procrastinate some more
What now?
Chipper demo
READ ON
Click here for more elaborate example or click here to read the docs