Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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