Skip to content

Instantly share code, notes, and snippets.

@dmitrika
Last active October 6, 2016 06:52
Show Gist options
  • Save dmitrika/6f2430beee275c6f21f3da66b7e38001 to your computer and use it in GitHub Desktop.
Save dmitrika/6f2430beee275c6f21f3da66b7e38001 to your computer and use it in GitHub Desktop.
import {handleActions} from 'redux-actions';
import * as actions from '../Constants/Constants';
const initialState = {
};
const LikesReducer = handleActions({
[actions.X]: state => ({
...state,
}),
}, initialState);
///
import {createAction} from 'redux-actions';
export const handleLikeClick = createAction(
actions.HANDLE_CLICK,
);
export const getDataRequest = () => (dispatch) => {
// fetch data
};
///
import {bindActionCreators} from 'redux';
import {connect} from 'react-redux';
const mapStateToProps = (state, ownProps) => ({
///
});
const mapDispatchToProps = (dispatch) => bindActionCreators({
///
}, dispatch);
connect(mapStateToProps, mapDispatchToProps)(Component);
///
import {Provider} from 'react-redux';
import {createStore} from 'redux';
let store = createStore(LikesReducer);
<Provider store={store}><App /></Provider>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment