Getting Started with the Redux JavaScript Library
Course Objectives
Working in a hands-on learning environment, guided by our expert team, attendees will be able to:
- Simplify complex state management with the Redux library
- Use best practices for reducers, dispatchers, and action creators
- Explain and leverage reducer composition
- Understand when, how, and why to use Redux middleware
- Handle asynchronous operations with Redux -- including Ajax
- Integrate a Redux store into a React application
Course Prerequisites
This fast-paced course is for intermediate skilled web developers new to React who have prior experienced working HTML5, CSS3 and JavaScript.
Take Before: Attendees should have experience with the topics in the following courses, or should have recently attended these as a pre-requisite:
- TT4003: Introduction to HTML5 / CSS3 & JavaScript Essentials
Please see the Related Courses tab for Pre-Requisite course specifics and links, links to similar courses you might review as an alternative, as well as suggested Next-Step Follow-On Courses and Learning Path recommendations.
Course Agenda
Please note that this list of topics is based on our standard course offering, evolved from typical industry uses and trends. We’ll work with you to tune this course and level of coverage to target the skills you need most.
Getting Started
Redux intro
The single responsibility principle
Why Redux?
Why Redux with React?
Its history and growth
The 4 concepts of Redux
State
Pure functions
Composition
Immutability
The parts of Redux
The big picture of Redux
Creating the store
Installing and including Redux
The createStore() method
The simplest possible store
State and Subscriptions
Single source of truth
Initializing state
What goes in state?
Why subscriptions?
How to subscribe in Redux
Actions and Reducers 101
Actions are objects
The shape of actions
Type and payload
Reducers are functions
Why we have them
The shape of a reducer
Tips in avoiding the worst Redux rookie mistakes
Actions
Action Creators in a React Application
Dispatching Actions
Mapping Actions to prop Names
Advanced Actions
Action constants
Action type enumerations
Action creators
Action creator enumerations
Reducer composition
The problem: complex state => complex reducers
The solution: Create state slices
Creating reducers to handle slices
Combining reducers with Redux's built-in combineReducers
Doing it manually
Why manually is the right way
Redux Middleware
The Open-Closed Principle
Introduction to middleware
The next() function
The required shape of middleware
Middleware's super-powers
Recipes and examples
Why you must register middleware and how to do it
Ajax with Redux
The problem with async calls in Redux
The trick to making a good middleware function
Registering the middleware
Dispatching an Ajax call
Making RESTful API calls
How to process them into Redux and then into React
Redux-thunk (Time permitting)
The need for a thunk
How redux-thunk fits that need
Installing and using redux-thunk properly
Dispatching Ajax calls with redux-thunk
Sorry! It looks like we haven’t updated our dates for the class you selected yet. There’s a quick way to find out. Contact us at 502.265.3057 or email info@training4it.com
Request a Date