An intermediate tutorial app aimed at furthering React and Redux concepts and knowledge. This tutorial is aimed at:
- Implementing CRUD routes
- Utilizing react-router V4
- Utilizing redux-form v6
The following README.md
is to consolidate the key learning points for future reference.
The tutorial can be found here
- Use objects over arrays to store data.
- Allows ease of access to specific data set.
- Ex. using the lodash library:
export default function(state = {}, action) {
switch (action.type) {
case FETCH_POSTS:
return _.mapKeys(action.payload.data, 'id');
default:
return state;
}
}
- If an object is passed, each function inside it is assumed to be a Redux action creator.
connect(mapStateToProps, { fetchPosts })(PostsIndex);