1.0.10 • Published 8 years ago

renux v1.0.10

Weekly downloads
1
License
MIT
Repository
-
Last release
8 years ago

express-like react flux implementation

define the action and state(store)

var renux = require('renux')
var store = renux({/*initialState*/})

var router = renux.router()
router.use('/action/path', function(req, resp, next){//action middleware
  req.store.state //current(old) state
  req.body //get the params
  req.pathname //get the action path
  resp.send({/*new state*/}) //set the new state object 
})
store.use(router)

wrap the react component

store.component(App) // App = React.createClass({...})

call the action in the component

this.props.store.dispatch('/action/path', {/*params*/})

TODO

  • react test case

License

Licensed under MIT

Copyright (c) 2015-2016 kiliwalk

1.0.10

8 years ago

1.0.9

8 years ago

1.0.8

8 years ago

1.0.7

8 years ago

1.0.6

8 years ago

1.0.5

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago