Open egoist opened 6 years ago
import zerotwo, { Store, Provider } from 'zerotwo'
Vue.use(zerotwo)
class CounterStore extends Store {
state = {
count: 0
}
inc = () => {
this.state.count++
}
}
new Vue({
store: CounterStore,
template: `
<store-consumer>
<div slot-scope="store">
<button @click="store.inc">{{ store.state.count }}</button>
</div>
</store-consumer>
`
})
https://github.com/jamiebuilds/unstated