Last active
October 6, 2016 06:52
-
-
Save dmitrika/6f2430beee275c6f21f3da66b7e38001 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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