Bummer! This is just a preview. You need to be signed in with a Basic account to view the entire video.
Start a free Basic trial
to watch this video
In this video, you'll learn the benefits Redux can add to your applications.
Further Reading
-
0:00
In the previous video, you learned some of the basics of Redux.
-
0:03
And I've provided preliminary information for
-
0:05
components in a React Redux application.
-
0:08
But now, you may be wondering, why should I bother using Redux in the first place?
-
0:11
Or, when should I actually use it?
-
0:14
Redux does add substantial overhead to your project and
-
0:17
expects you to follow some very explicit patterns.
-
0:20
So let's discuss some of the benefits you'll have when you incorporate
-
0:22
Redux into your applications.
-
0:25
But before we do that, I should also mention that Redux does not require
-
0:29
that you use React as your view library.
-
0:31
We simply chose to reuse the scoreboard app because reacting redux align
-
0:35
themselves almost perfectly.
-
0:37
And React provides a written familiar environment to work in.
-
0:40
First, let's start with a very common scenario in application development.
-
0:45
You've decided to build an application, and you've heard great things about react.
-
0:48
So you immediately start building components and
-
0:51
wiring up a really nice looking UI.
-
0:53
Your app is tested, regularly launched, and everything is going great.
-
0:56
So what could possibly go wrong?
-
0:58
Well, shortly after the successful launch of your app,
-
1:01
you realized that you need to make some changes to the app.
-
1:04
And that a number of changes involve sharing data across components
-
1:07
within the application.
-
1:08
Not only do you need to create the new UI components to support the new
-
1:11
development request.
-
1:13
But you also need to figure out a way to synchronize and
-
1:15
share data throughout the application.
-
1:18
Redux to the rescue.
-
1:19
Redux comes equipped with the facilities to provide a single source of truth for
-
1:23
your application.
-
1:24
Making it easier to keep your application state in sync, and
-
1:27
distribute state data in a predictable and deterministic way.
-
1:31
Resulting in a more reliable and stable application.
-
1:34
In other words, when you use Redux with React, Redux handles all your
-
1:38
data management while React only manages the presentation and the use of your app.
-
1:43
So now, we know that one of the primary benefits of Redux is
-
1:46
its ability to make applications more predictable, scalable, and
-
1:49
stable, but what other benefits are there?
-
1:52
Redux is considered to be an opinionated framework.
-
1:55
This means that Redux expects you to implement features a specific way.
-
1:59
Otherwise, you're app will not work as you would expect.
-
2:02
This is good for a couple of reasons.
-
2:04
First, it means that Redux should be implemented following a consistent pattern
-
2:09
making it easier for anyone familiar with Redux to look at another app using Redux,
-
2:13
and immediately feel right at home with the application structure.
-
2:17
Second, by following the design patterns recommended by redux.
-
2:21
It makes debugging and testing your application much easier because
-
2:24
application responsibilities are distinct and isolated.
-
2:29
Now that we've covered a few of the benefits of why Redux is a valuable
-
2:32
framework, it's time to jump into creating our project.
-
2:35
But before we do, I want to re-emphasize that React applications do
-
2:38
not require that you use Redux.
-
2:41
In fact, for a very simple react application or
-
2:44
a web application that only uses minimal React components, Redux is overkill.
-
2:49
So one of the things you should do before implementing Redux is make sure that
-
2:52
your application will benefit from using it.
-
2:56
There's a fantastic article about using Redux written by the creator of Redux,
-
3:01
that can be found in the teachers notes for this video.
-
3:03
So I encourage you to check that out, along with other information about some of
-
3:06
the powerful features and benefits that Redux will bring to your application.
You need to sign up for Treehouse in order to download course files.
Sign up