1.4.0 • Published 6 years ago
dahlia-store v1.4.0
dahlia-store
State management for Dahlia
Installation
yarn add dahlia-store
Quick Start
import React from 'react'
import { createStore, observe } from 'dahlia-store'
const store = createStore({
count: 1,
increment() {
store.count++
},
decrement() {
store.count--
},
async asyncIncrement() {
await new Promise(resolve => setTimeout(resolve, 1000))
store.count++
},
})
const App = observe(() => (
<div>
<span>{store.count}</span>
<button onClick={store.decrement}>-</button>
<button onClick={store.increment}>+</button>
<button onClick={store.asyncIncrement}>async+</button>
</div>
))
ReactDOM.render(<App />, document.getElementById('root'))
License
1.4.0
6 years ago
1.3.5
6 years ago
1.3.4
6 years ago
1.3.3
6 years ago
1.3.2
6 years ago
1.3.1
6 years ago
1.3.0
6 years ago
1.2.20
6 years ago
1.2.19
6 years ago
1.2.18
6 years ago
1.2.16
6 years ago
1.2.15
6 years ago
1.2.14
6 years ago
1.2.13
6 years ago
1.2.12
6 years ago
1.2.11
6 years ago
1.2.10
6 years ago
1.2.9
6 years ago
1.2.8
6 years ago
1.2.7
6 years ago
1.2.6
6 years ago
1.2.5
6 years ago
1.2.4
6 years ago
1.2.3
6 years ago
1.2.2
6 years ago
1.2.1
6 years ago
1.2.0
6 years ago
1.1.1
6 years ago
1.1.0
6 years ago
1.0.6
6 years ago
1.0.5
6 years ago
1.0.4
6 years ago
1.0.3
6 years ago
1.0.2
6 years ago
1.0.1
6 years ago
1.0.0
6 years ago
0.1.0
6 years ago