Companion repo
valentinogagliardi / react-redux-tutorial Goto Github PK
View Code? Open in Web Editor NEWCompanion repo for React Redux Tutorial for Beginners
Home Page: https://www.valentinog.com/blog/redux/
License: MIT License
Companion repo for React Redux Tutorial for Beginners
Home Page: https://www.valentinog.com/blog/redux/
License: MIT License
First of all, thank you very very much for this great tutorial. It is much, much more clear than the redux
and react-redux
tutorials/documentations combined!
I have a small suggestion: replace { getData }
on line 33 of Posts.js
with a mapDispatchToProps
function that extends the mapDispatchToProps
function used up to this point in the tutorial as follows
function mapDispatchToProps(dispatch) {
return {
addArticle: article => dispatch(addArticle(article))
getData: () => dispatch(getData())
};
}
export default connect(
mapStateToProps,
mapDispatchToProps
)(Post);
I'm suggesting this change since it took me a while to figure out why this.props.getData()
on line 11 works without a call to dispatch
. It is only after I looked at the connect
docs that I learned that passing an object instead of a function to connect
binds dispatch
to each action creator.
Don' get me wrong: it's useful to know about the Object Shorthand Form. It's just that it's a bit much when learning the basics. :)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.