Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fengzilong/reo
🍯 regularjs and stateman based spa framework, inspired by redux, vuex and choo
https://github.com/fengzilong/reo
dva redux regularjs spa state stateman time-travel vuex
Last synced: 2 months ago
JSON representation
🍯 regularjs and stateman based spa framework, inspired by redux, vuex and choo
- Host: GitHub
- URL: https://github.com/fengzilong/reo
- Owner: fengzilong
- License: mit
- Created: 2016-09-23T02:22:21.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-08-08T09:10:09.000Z (over 6 years ago)
- Last Synced: 2024-04-24T13:22:01.135Z (9 months ago)
- Topics: dva, redux, regularjs, spa, state, stateman, time-travel, vuex
- Language: JavaScript
- Homepage:
- Size: 277 KB
- Stars: 14
- Watchers: 1
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# reo
[![build][build-image]][build-url]
inspired by [redux](https://github.com/reactjs/redux), [vuex](https://github.com/vuejs/vuex) and [choo](https://github.com/choojs/choo)
## Overview
```js
import reo from 'reo'const app = reo()
app.use( plugin )
app.model( ... )
app.actions( ... )
app.getters( ... )
app.router( ... )
app.start( '#app' )
```## Real world example
```js
import reo from 'reo'const app = reo()
app.model( {
name: 'counter',
state: { count: 0 },
reducers: {
add( state ) {
state.count++
},
minus( state ) {
state.count--
}
}
} )app.getters( {
count: state => state.counter.count
} )app.actions( {
add( { commit } ) {
commit( 'counter/add' )
},
minus( { commit } ) {
commit( 'counter/minus' )
}
} )const Counter = {
getters: {
c: 'count'
},
template: `
-
{ c }
+
`,
}app.router( {
routes: [
{ path: '/', component: Counter }
]
} )app.start( '#app' )
```## License
MIT © [fengzilong](https://github.com/fengzilong)
[build-image]: https://img.shields.io/circleci/project/fengzilong/reo/master.svg?style=flat-square
[build-url]: https://circleci.com/gh/fengzilong/reo