feast-redux

0.3.0 • Public • Published

Feast Redux

Experimental Feast bindings for Redux.

Examples

Usage

// ./blocks/app.js
import feast from 'feast';
import {connect} from 'feast-redux';
import template from './app.html';
import {singin} from '../path/to/actions';

const UIApp = feast.Block.extend({
	name: 'app',
	template,
	eventsToActions: {
		'remited-event-name': {
			action: singin,
			arguments: (app, evt) => [app.refs.login.value, app.refs.password.value]
		}
	}
});

export default connect(
	(state) => state, // mapStateToAttrs
	(dispatch) => ({dispatch}) // mapDispatchToAttrs
)(UIApp);

// index.js
import App from './blocks/app.js';
import configureStore from './store/configureStore';

const store = configureStore();

new App({}, {store}).renderTo(document.getElementById('root'));

Readme

Keywords

Package Sidebar

Install

npm i feast-redux

Weekly Downloads

7

Version

0.3.0

License

MIT

Last publish

Collaborators

  • rubaxa