Skip to content

MatulaDesign/lumberyard-chipper

Repository files navigation

Chipper

A minimalistic state-management tool for your megalomaniac React needs.

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?

Click here for more elaborate example or click here to read the docs

About

A minimalistic state-management tool for your megalomaniac React needs

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published