1
00:00:00,360 --> 00:00:00,760
All right.

2
00:00:00,780 --> 00:00:03,480
And once we're familiar why we're using years or so.

3
00:00:04,140 --> 00:00:05,910
Now let's wire up that register.

4
00:00:06,780 --> 00:00:12,360
At the moment, our producer is empty and essentially what I want to do is set up a function that's

5
00:00:12,360 --> 00:00:17,310
looking for two things for the current state and the action that is dispatched.

6
00:00:17,790 --> 00:00:19,680
And also in the app context.

7
00:00:19,980 --> 00:00:21,870
We want to import the producer.

8
00:00:22,260 --> 00:00:30,010
We're just sitting in the file right next door and then instead of you state the damage to the body,

9
00:00:30,030 --> 00:00:33,390
we currently have micro, we're going to use the reducer.

10
00:00:33,720 --> 00:00:39,030
And then the first thing that we present is this function, which again is going to access the state

11
00:00:39,030 --> 00:00:46,980
and action and then also get the initial state and then we can start setting up our first actions.

12
00:00:47,400 --> 00:00:49,440
So let's navigate to a reducer.

13
00:00:50,480 --> 00:00:53,420
And we're going to go here with producer function.

14
00:00:53,660 --> 00:00:59,240
It's going to be equal to a state and action and not inside of function body.

15
00:00:59,570 --> 00:01:00,770
We'll just throw the error.

16
00:01:01,220 --> 00:01:08,270
So this is going to run if we'll dispatch some kind of action that's not actually handled in our industry.

17
00:01:08,960 --> 00:01:12,380
And this case is I want to access the action type.

18
00:01:12,860 --> 00:01:20,900
I'm going to go with template strength and then like, just say no such action and colon and let's access

19
00:01:20,900 --> 00:01:21,860
the action type.

20
00:01:22,610 --> 00:01:29,660
So I'm going to go here for my intuition and let's just say action and then Typekit.

21
00:01:29,840 --> 00:01:36,230
Now we're due on to as default, so export default and we're looking for the reducer.

22
00:01:36,650 --> 00:01:43,970
And then back in the app context, let's scroll up and before or after the initial state, I mean,

23
00:01:43,970 --> 00:01:45,110
I'm going to do it above it.

24
00:01:45,570 --> 00:01:51,710
We're going to go with the import VAT reducer from, like I said, it's right next door.

25
00:01:51,920 --> 00:01:56,150
So we'll look forward to sir and then we might as well remove the use state.

26
00:01:56,270 --> 00:02:01,010
We're not going to use it and replace it with a huge reducer.

27
00:02:01,430 --> 00:02:06,830
And that in here we're looking for two things we're looking for the reducer.

28
00:02:07,250 --> 00:02:11,000
So that's going to be the function which will handle our dispatch.

29
00:02:11,360 --> 00:02:18,320
And this is going to be our initial state online where we have state and such that since we're not using

30
00:02:18,320 --> 00:02:21,080
usthat, we're actually using reducer.

31
00:02:21,350 --> 00:02:24,310
Most are going to rename this as this patch.

32
00:02:24,560 --> 00:02:28,010
So that way, we know for sure that we're using use reducer.

33
00:02:28,550 --> 00:02:32,810
And with these changes in place, we can start setting up our first actions.

