⚠️ This lesson is retired and might contain outdated information.

Introducing Reduce Redux Boilerplate with Redux-Actions

Andy Van Slaars
InstructorAndy Van Slaars
Share this video with your friends

Social Share Links

Send Tweet
Published 6 years ago
Updated 2 years ago

One of the biggest complaints people tend to have about Redux is the amount of boilerplate code you end up writing to use it. It doesn't have to be that way!

Redux actions will simplify the code for our action creators and even give us a new way to create our reducers.

By using redux-actions, our application will use Flux Standard Actions, keeping the way we manage our state more consistent.

This small library only exposes a few functions for its API, so it won't take long to learn, but it will make a huge difference in how we write action creators and reducers for redux.

Instructor: [00:00] One of the biggest complaints people tend to have about Redux is the amount of boilerplate code you end up writing to use it. It doesn't have to be that way.

[00:08] In this course, we'll start with a fully functioning react and Redux application. This application is wired up with constants for our actions, action creators, reducer using a switch statement like you would expect, and redux func middleware for handling async actions.

[00:21] We've cut down on the cognitive overload a bit by colocating action constants creators and the reducer code but worry factor this even further. We'll install the Redux actions library as a dependency, and look at it small, but powerful API. Redux actions will simplify the code for our action creators, and even give us a new way to create our reducers.

[00:42] By using Redux actions or application we use Flux standard actions. Keeping the way, we manage our state more consistent. With that consistency, we'll open up capabilities to enhance on reducer to handle errors within the context of specific actions.

[00:56] We'll also cover how to attach metadata to our actions without adding clutter to our payloads. This small library only exposes a few functions for its API, so it won't take long to learn, but it will make a huge difference in how we write action creators and reducers for Redux.

Steve Bond
Steve Bond
~ 6 years ago

Great course. Where can I access the code please? There was a tab for that but after I signed up it disappeared. Pretty frustrating that!

Andy Van Slaars
Andy Van Slaarsinstructor
~ 6 years ago

Steve, Here’s a link for you: https://github.com/avanslaars/redux-actions-course/

Each course with code should have a code tab that takes you to the appropriate branch. Hope this helps!

Steve Bond
Steve Bond
~ 6 years ago

Thanks Andy! Great course BTW.


Rodolfo
Rodolfo
~ 6 years ago

Thanks! this course is awesome! I'm trying to implement this with typescript, do you know about a good resource?

Andy Van Slaars
Andy Van Slaarsinstructor
~ 6 years ago

Rodolfo,

I don't have anything specific to redux-actions with TypeScript. You might find the Use TypeScript to develop React Applications course helpful for React and TypeScript. Also, there are types for redux-actions here: https://www.npmjs.com/package/@types/redux-actions. Hope this helps.

Markdown supported.
Become a member to join the discussionEnroll Today