2.0.1 • Published 8 years ago

reo v2.0.1

Weekly downloads
5
License
MIT
Repository
github
Last release
8 years ago

reo

build

inspired by redux, vuex and choo

Overview

import reo from 'reo'

const app = reo()
app.use( plugin )
app.model( ... )
app.actions( ... )
app.getters( ... )
app.router( ... )
app.start( '#app' )

Real world example

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: `
		<button on-click="{ this.dispatch( 'minus' ) }">-</button>
		{ c }
		<button on-click="{ this.dispatch( 'add' ) }">+</button>
	`,
}

app.router( {
	routes: [
		{ path: '/', component: Counter }
	]
} )

app.start( '#app' )

License

MIT © fengzilong

2.0.1

8 years ago

2.0.0

8 years ago

1.4.4

8 years ago

1.4.3

8 years ago

1.4.2

9 years ago

1.4.1

9 years ago

1.4.0

9 years ago

1.3.0

9 years ago

1.2.0

9 years ago

1.1.0

9 years ago

1.0.0

9 years ago

0.2.0

9 years ago

0.1.1

9 years ago

0.1.0

9 years ago

0.0.8

9 years ago

0.0.7

10 years ago

0.0.6

10 years ago

0.0.5

10 years ago

0.0.4

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago

0.0.0

10 years ago