1
00:00:01,180 --> 00:00:05,950
Well, we've just about got every last individual piece of our redox application put together, the

2
00:00:05,950 --> 00:00:09,910
last thing we really have to do is start to wire all this stuff together and create an actual reduc

3
00:00:09,920 --> 00:00:10,340
store.

4
00:00:10,900 --> 00:00:14,500
I'm going to first begin by going into my reducers directory inside.

5
00:00:14,570 --> 00:00:18,610
I'm going to make a new file called Index Dots inside of here.

6
00:00:18,620 --> 00:00:20,510
I'm going to import all of my different reducers.

7
00:00:20,530 --> 00:00:21,520
Right now, there's only one.

8
00:00:21,700 --> 00:00:26,650
And we're going to use that combined reducers function that we get from Rydex to combine everything

9
00:00:26,650 --> 00:00:27,040
together.

10
00:00:27,880 --> 00:00:36,310
So at the very top, I will import combine reducers from Redux, I'll then import my reducer, which

11
00:00:36,310 --> 00:00:37,060
we had called.

12
00:00:38,970 --> 00:00:41,550
I think we just explored it as default, that's totally fine.

13
00:00:42,060 --> 00:00:45,390
So I'm going to import repositories reducer.

14
00:00:47,160 --> 00:00:49,860
From the repositories reducer file.

15
00:00:52,160 --> 00:00:56,600
I'll then create a new variable called Reducers, and that's going to be the result of calling combined

16
00:00:56,600 --> 00:00:57,320
reducers.

17
00:00:59,000 --> 00:01:04,390
I'm going to say that we want to have a reducers piece of me, not reducers, but repositories.

18
00:01:04,400 --> 00:01:08,750
There we go, piece of states and the value for this piece of state is going to come from the repositories

19
00:01:08,750 --> 00:01:09,320
reducer.

20
00:01:13,380 --> 00:01:18,430
And then finally, I will export default reducers to nothing very crazy inside of Europe.

21
00:01:18,450 --> 00:01:22,110
This looks like what we would normally write out inside of a JavaScript Redux project.

22
00:01:23,630 --> 00:01:27,350
All right, well, that's the last kind of little part we have to put together, so now we can combine

23
00:01:27,560 --> 00:01:31,050
all these different parts into our actual redux story.

24
00:01:31,700 --> 00:01:33,920
I'm going to create our story inside of a new file.

25
00:01:34,040 --> 00:01:35,450
I'm going to inside the state directory.

26
00:01:35,760 --> 00:01:38,780
I'm going to call this new file, Staats.

27
00:01:40,660 --> 00:01:42,400
Inside of here, we will import.

28
00:01:43,700 --> 00:01:44,480
Create store.

29
00:01:45,460 --> 00:01:49,240
Apply middleware, we're going to get both those from Redox.

30
00:01:51,390 --> 00:01:54,570
I will get thunk from redox thunk.

31
00:01:55,850 --> 00:02:01,370
And then finally, our reducers, so we just set up from the reducers directory.

32
00:02:03,310 --> 00:02:08,889
Then finally, at the very bottom, I will export CONSED store and the result of that is going to come

33
00:02:08,889 --> 00:02:16,180
from create store, pass in reducers, pass in an initial state argument of an empty object.

34
00:02:17,150 --> 00:02:19,220
And I will apply middleware.

35
00:02:20,520 --> 00:02:25,440
And I'm going to apply the redox thunk middleware, let me zoom out just for a moment so you can see

36
00:02:25,440 --> 00:02:26,310
that entire line.

37
00:02:29,840 --> 00:02:35,270
All right, let's just about it let's remember one thing we discussed just a little bit ago, we had

38
00:02:35,270 --> 00:02:41,120
said that it's really nice if we do not try to take things one at a time out of our redox directory

39
00:02:41,150 --> 00:02:43,850
whenever we're trying to wired up to the back side of our application.

40
00:02:44,060 --> 00:02:49,820
Instead, if we have a central index file inside of our root redox folder, in our case, we called

41
00:02:49,820 --> 00:02:55,280
it the state folder, we can then import everything from our action creators and middleware, all these

42
00:02:55,280 --> 00:03:00,560
different locations into this index ortez file and then export them from there and just make sure that

43
00:03:00,560 --> 00:03:05,180
we're not trying to import stuff from these individual files one at a time, which again, generally

44
00:03:05,180 --> 00:03:06,650
ends up being just a little bit confusing.

45
00:03:08,950 --> 00:03:12,670
So the last thing we have to do on the right side of our project inside of states, I'm going to make

46
00:03:12,670 --> 00:03:14,890
an index dots file.

47
00:03:15,840 --> 00:03:20,160
And then from here, like I said, we're going to export everything that we might need to get access

48
00:03:20,160 --> 00:03:22,140
to from other parts of our project.

49
00:03:23,110 --> 00:03:30,160
The first thing I'm going to export is star from our store file we just created, so that means now

50
00:03:30,160 --> 00:03:34,420
that exported from this file is going to be a store variable.

51
00:03:35,600 --> 00:03:37,820
I'm also going to export star.

52
00:03:38,710 --> 00:03:40,960
As action creators.

53
00:03:42,030 --> 00:03:49,500
From actions must mean action creators that saying, go into our action, Graeter's index dots file,

54
00:03:49,710 --> 00:03:55,050
find all the named experts inside of here and just export Altham as something called action creators.

55
00:03:56,650 --> 00:04:01,890
I think that's pretty much it for right now, there is going to eventually be one or two other experts

56
00:04:01,890 --> 00:04:05,400
we add inside of here, but we're not going to add them in just yet because they're not going to quite

57
00:04:05,400 --> 00:04:06,390
make sense right now.

58
00:04:06,420 --> 00:04:09,270
So eventually, a little bit more is going to be added into this file.

59
00:04:10,140 --> 00:04:11,260
All right, so it looks pretty good.

60
00:04:11,880 --> 00:04:13,080
Well, we can take a pause right here.

61
00:04:13,120 --> 00:04:17,760
Come back in the next video and we're going to start to wire up the right side of our application to

62
00:04:17,760 --> 00:04:18,750
the backside.

