1 00:00:00,990 --> 00:00:03,060 Narrator: So, we've got a slightly better idea 2 00:00:03,060 --> 00:00:05,700 of how middlewares work in Redux now. 3 00:00:05,700 --> 00:00:07,110 They are sitting in between 4 00:00:07,110 --> 00:00:09,450 our action creators and our reducers, 5 00:00:09,450 --> 00:00:11,730 and they intercept any actions. 6 00:00:11,730 --> 00:00:13,500 Once an action flows into a middleware, 7 00:00:13,500 --> 00:00:16,560 the middleware can choose to console log it, 8 00:00:16,560 --> 00:00:17,393 it can delete it, 9 00:00:17,393 --> 00:00:18,420 it can stop it in its tracks, 10 00:00:18,420 --> 00:00:19,253 it can modify it. 11 00:00:19,253 --> 00:00:21,180 Basically, anything we really want to do, 12 00:00:21,180 --> 00:00:23,040 we can do inside of a middleware. 13 00:00:23,040 --> 00:00:24,390 And, as we work through this example, 14 00:00:24,390 --> 00:00:26,190 we'll see some of the different conditions 15 00:00:26,190 --> 00:00:27,690 or situations where we might want to 16 00:00:27,690 --> 00:00:30,420 take all these different sorts of actions. 17 00:00:30,420 --> 00:00:32,070 One other thing that we did in the last section 18 00:00:32,070 --> 00:00:35,310 was we installed our boilerplate package. 19 00:00:35,310 --> 00:00:36,960 We also installed our dependencies, 20 00:00:36,960 --> 00:00:38,580 just to make sure that everything is installed 21 00:00:38,580 --> 00:00:39,720 and running A-okay, 22 00:00:39,720 --> 00:00:41,340 I'm gonna start up my development server 23 00:00:41,340 --> 00:00:44,130 with "npm run start", 24 00:00:44,130 --> 00:00:46,110 and then let's flip over to the browser, 25 00:00:46,110 --> 00:00:47,070 and I'm just gonna verify 26 00:00:47,070 --> 00:00:49,020 that everything is showing up properly. 27 00:00:53,640 --> 00:00:54,473 And, there we go. 28 00:00:54,473 --> 00:00:55,710 React simple starter at the top. 29 00:00:55,710 --> 00:00:56,970 Very good. 30 00:00:56,970 --> 00:00:58,020 All right, let's spend some time 31 00:00:58,020 --> 00:00:58,920 to talk a little bit more 32 00:00:58,920 --> 00:01:01,110 about the app that we're going to be building, 33 00:01:01,110 --> 00:01:03,900 and specifically, how we're gonna be building it. 34 00:01:03,900 --> 00:01:05,190 So, first thing I'm gonna pull 35 00:01:05,190 --> 00:01:07,080 onto the screen is a mock-up of the app 36 00:01:07,080 --> 00:01:09,090 that we're going to build. 37 00:01:09,090 --> 00:01:10,650 So, it's gonna be pretty simple, 38 00:01:10,650 --> 00:01:11,580 pretty straightforward. 39 00:01:11,580 --> 00:01:13,470 Again, the real goal here is not to 40 00:01:13,470 --> 00:01:15,030 build an interesting app so much 41 00:01:15,030 --> 00:01:18,570 as it is to figure out how middleware works. 42 00:01:18,570 --> 00:01:20,580 So, our app is gonna be very straightforward. 43 00:01:20,580 --> 00:01:22,560 We're gonna make an AJAX request 44 00:01:22,560 --> 00:01:24,390 to load up a list of users, 45 00:01:24,390 --> 00:01:26,670 and then we're gonna show one badge 46 00:01:26,670 --> 00:01:29,370 or profile component per user. 47 00:01:29,370 --> 00:01:31,530 And, on each of these profiles, 48 00:01:31,530 --> 00:01:34,650 we should have the user's name, 49 00:01:34,650 --> 00:01:35,483 which, in this case, 50 00:01:35,483 --> 00:01:36,870 I just called the user, 51 00:01:36,870 --> 00:01:37,860 their company name, 52 00:01:37,860 --> 00:01:39,570 so, what company they represent, 53 00:01:39,570 --> 00:01:41,790 and, a very simple button that's just going to 54 00:01:41,790 --> 00:01:43,260 allow us to click it and open 55 00:01:43,260 --> 00:01:46,770 our favorite email editor or email client 56 00:01:46,770 --> 00:01:49,410 and send an email to that very particular user. 57 00:01:49,410 --> 00:01:51,000 So again, the goal here is not so much to 58 00:01:51,000 --> 00:01:52,260 work on the React side of things. 59 00:01:52,260 --> 00:01:54,630 The, the goal here is to work on the Redux side 60 00:01:54,630 --> 00:01:57,720 of things and figure out more about middleware. 61 00:01:57,720 --> 00:01:59,460 So, on that topic, let's talk more 62 00:01:59,460 --> 00:02:01,983 about exactly how we're gonna build our app. 63 00:02:03,990 --> 00:02:05,190 So, this is our process, 64 00:02:05,190 --> 00:02:07,050 or how we're gonna put everything together. 65 00:02:07,050 --> 00:02:07,980 This isn't information 66 00:02:07,980 --> 00:02:09,180 that's super critical to have. 67 00:02:09,180 --> 00:02:10,199 I just wanna make sure that 68 00:02:10,199 --> 00:02:11,730 it's really clear to you 69 00:02:11,730 --> 00:02:13,290 how we're gonna build the application 70 00:02:13,290 --> 00:02:15,432 and, you know, some of the little pitfalls 71 00:02:15,432 --> 00:02:17,430 as we're going through here. 72 00:02:17,430 --> 00:02:19,050 So, the first thing we're gonna do is, 73 00:02:19,050 --> 00:02:20,910 we're going to build our entire application 74 00:02:20,910 --> 00:02:22,290 with just dummy data. 75 00:02:22,290 --> 00:02:23,880 So, dummy data in this case is 76 00:02:23,880 --> 00:02:26,910 data that we're just going to statically write 77 00:02:26,910 --> 00:02:27,870 on the client side. 78 00:02:27,870 --> 00:02:29,880 We're literally gonna write in objects, 79 00:02:29,880 --> 00:02:32,103 one for each profile that we wanna show. 80 00:02:33,360 --> 00:02:35,910 After we get our entire app working 81 00:02:35,910 --> 00:02:36,810 with this dummy data, 82 00:02:36,810 --> 00:02:39,150 so, this kind of client side data, 83 00:02:39,150 --> 00:02:41,670 we're going to replace the dummy data 84 00:02:41,670 --> 00:02:43,020 with an AJAX request. 85 00:02:43,020 --> 00:02:43,853 So, we're gonna say, 86 00:02:43,853 --> 00:02:45,750 Okay, we're no longer gonna use this client side only, 87 00:02:45,750 --> 00:02:47,160 just the dummy data. 88 00:02:47,160 --> 00:02:48,630 Instead, we're going to load it off 89 00:02:48,630 --> 00:02:49,920 of a third-party server, 90 00:02:49,920 --> 00:02:52,353 some external service to our application. 91 00:02:53,580 --> 00:02:55,500 Only after we've done this 92 00:02:55,500 --> 00:02:57,510 kind of AJAX loading portion 93 00:02:57,510 --> 00:02:59,130 are we going to write the middleware 94 00:02:59,130 --> 00:03:00,900 that we actually want to, you know, 95 00:03:00,900 --> 00:03:02,310 get at and learn more about. 96 00:03:02,310 --> 00:03:03,900 So, this is where we will hopefully spend 97 00:03:03,900 --> 00:03:04,830 the bulk of our time. 98 00:03:04,830 --> 00:03:06,630 We're going to write a middleware 99 00:03:06,630 --> 00:03:08,433 to help us fetch our data. 100 00:03:09,780 --> 00:03:10,613 We're gonna talk, 101 00:03:10,613 --> 00:03:11,531 be talking more about exactly 102 00:03:11,531 --> 00:03:13,020 what our middleware does, 103 00:03:13,020 --> 00:03:14,220 and what its purpose is. 104 00:03:14,220 --> 00:03:16,170 You know how it works, obviously, 105 00:03:16,170 --> 00:03:18,810 when we get into these later two sections. 106 00:03:18,810 --> 00:03:21,570 So, in the first portion of this, 107 00:03:21,570 --> 00:03:22,403 this entire section, 108 00:03:22,403 --> 00:03:24,210 we're going to be concerned 109 00:03:24,210 --> 00:03:25,560 only with building our app. 110 00:03:25,560 --> 00:03:26,790 We're gonna do it pretty quickly, 111 00:03:26,790 --> 00:03:28,380 since it's gonna be some pretty, 112 00:03:28,380 --> 00:03:29,520 you know, boring stuff. 113 00:03:29,520 --> 00:03:30,720 We're just showing the list of users. 114 00:03:30,720 --> 00:03:32,220 Nothing that exciting. 115 00:03:32,220 --> 00:03:33,480 So, we're gonna get through this stuff 116 00:03:33,480 --> 00:03:34,650 as fast as possible, 117 00:03:34,650 --> 00:03:35,700 and then we're gonna dive 118 00:03:35,700 --> 00:03:36,750 into the middleware stuff. 119 00:03:36,750 --> 00:03:38,340 Again, I just want it to be clear 120 00:03:38,340 --> 00:03:39,173 kinda the roadmap 121 00:03:39,173 --> 00:03:41,190 or the path we're we're gonna take here 122 00:03:41,190 --> 00:03:44,130 in getting to be more familiar with middleware. 123 00:03:44,130 --> 00:03:45,360 Okay? So, with that in mind, 124 00:03:45,360 --> 00:03:46,980 I will catch you in the next section, 125 00:03:46,980 --> 00:03:48,630 where we will start building our app 126 00:03:48,630 --> 00:03:49,863 with some dummy data.