Doura is a decentralized state management solution based on the concept of model. It's very simple and intuitive.
- 🔑 100% TypeScript Support
- ⚛️ Reactive and Immutable
- 🔗 Models are organized in a decentralized way
Install with npm:
npm install doura
Install with yarn
yarn add doura
import { defineModel } from 'doura'
const countModel = defineModel({
state: {
count: 0,
},
actions: {
inc() {
this.count += 1
},
},
})
import { useModel } from 'react-doura'
function Counter() {
const counter = useModel(countModel)
return (
<div>
<h1>Count: {counter.count}</h1>
<button onClick={counter.inc}>inc</button>
</div>
)
}
Doura is greatly inspired by following excellent projects: