Skip to content

Instantly share code, notes, and snippets.

@MicroBenz
Last active December 4, 2017 16:13
Show Gist options
  • Save MicroBenz/0e3aa5493b7d618b2e33eb4c8c9e2ba6 to your computer and use it in GitHub Desktop.
Save MicroBenz/0e3aa5493b7d618b2e33eb4c8c9e2ba6 to your computer and use it in GitHub Desktop.
YWC15
// เอาไปสร้าง reducers
import { combineReducers } from 'redux';
import widgets from './ducks/widgets';
import auth from './ducks/auth';
const rootReducer = combineReducers({ auth, widgets });
export default rootReducer;
// เอาไป bind action กับ component
import * as widgetActions from './ducks/widgets';
// หรือ import เรียงอัน
import {loadWidgets, createWidget, updateWidget, removeWidget} from './ducks/widgets';
// ...
bindActionCreators({loadWidgets, createWidget, updateWidget, removeWidget}, dispatch);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment