1 00:00:00,680 --> 00:00:05,170 In the last section we put together our initial implementation of the author douceur. 2 00:00:05,370 --> 00:00:11,130 We're now going to change over to our producers index G-S file so it should be empty right now. 3 00:00:11,130 --> 00:00:15,200 Make sure you're not looking at the index G-S file in the SIRC directory. 4 00:00:15,240 --> 00:00:17,890 We're going to import the author reducer into here. 5 00:00:18,000 --> 00:00:21,330 We're going to combine it with a combined reducers call. 6 00:00:21,390 --> 00:00:22,920 Thanks to the redux library. 7 00:00:23,040 --> 00:00:25,810 And then immediately export it from this file. 8 00:00:25,830 --> 00:00:33,330 So at the top we'll start by importing combine reducers from redux. 9 00:00:33,330 --> 00:00:42,570 We will then import the author douceur that we just created as Auth. reducer from Auth. reducer and 10 00:00:42,570 --> 00:00:46,680 then we will place our combined reducers call and immediately export it. 11 00:00:46,680 --> 00:00:53,550 So export default combine reducers going to pass an empty object in and then we're going to wire up 12 00:00:53,550 --> 00:00:55,480 the author reducer inside of here. 13 00:00:55,890 --> 00:01:01,830 So remember one very important aspect of the combined reducers call this object that we're passing in 14 00:01:01,950 --> 00:01:08,610 whatever keys we provide to this object are going to represent the keys that exist inside of our state 15 00:01:08,730 --> 00:01:09,800 object. 16 00:01:09,810 --> 00:01:15,060 So traditionally we put at least a little bit of thought into the the names we give each of these keys 17 00:01:15,750 --> 00:01:16,970 for our author user. 18 00:01:16,980 --> 00:01:22,430 I think that a very clear solution here or a very clear name would be something like. 19 00:01:22,650 --> 00:01:24,200 Off like so. 20 00:01:24,540 --> 00:01:33,930 So we'll say the off piece of state is being manufactured or produced by the auth reducer like so. 21 00:01:34,370 --> 00:01:36,460 OK so this is looking pretty good. 22 00:01:36,540 --> 00:01:39,100 Now the very last step very less than we have to do. 23 00:01:39,120 --> 00:01:42,560 We're going to go back to our top level index file. 24 00:01:42,600 --> 00:01:47,790 We're going to import this reducer and then we'll pass it off to the create store call. 25 00:01:47,940 --> 00:01:51,720 So I'm going to go back to the top level index dot G-S file. 26 00:01:51,810 --> 00:01:55,670 I'm going to add in an import statement for all the different reducers. 27 00:01:55,770 --> 00:02:04,500 So import reducers from the reducers directory and it will pass that as the first argument to create 28 00:02:04,500 --> 00:02:06,460 store. 29 00:02:06,570 --> 00:02:11,950 So reducers like the tool looks good. 30 00:02:12,060 --> 00:02:16,530 Again I think that this is probably going to be a good place to do a little test inside the browser 31 00:02:16,590 --> 00:02:20,200 make sure that we haven't made any typos any errors anything like that. 32 00:02:20,250 --> 00:02:22,800 I'll first start off by checking out my terminal. 33 00:02:23,130 --> 00:02:27,240 Well make sure that my server is running without any error messages over here. 34 00:02:27,240 --> 00:02:33,270 I will then change back over to the browser and go back to the re-act up and it looks like I still have 35 00:02:33,270 --> 00:02:33,870 my text. 36 00:02:33,870 --> 00:02:35,220 Hi there on the screen. 37 00:02:35,590 --> 00:02:36,980 OK this is looking pretty good. 38 00:02:37,110 --> 00:02:41,940 If you see any error messages at this point it likely means that you might have a little typo somewhere 39 00:02:42,180 --> 00:02:43,600 inside the set up we just did. 40 00:02:43,770 --> 00:02:47,870 So I encourage you always to do a little bit of trouble shooting on your end. 41 00:02:48,000 --> 00:02:52,420 See if there is any easy to find errors and small typos or anything like that. 42 00:02:52,590 --> 00:02:53,840 If you find it great. 43 00:02:53,940 --> 00:02:56,090 If you can't find it let me know. 44 00:02:56,100 --> 00:02:58,440 Post a run discussion include a screenshot. 45 00:02:58,470 --> 00:03:01,760 Tell me what the error messages that you see at this point. 46 00:03:01,770 --> 00:03:03,300 If you are seeing an error here. 47 00:03:03,470 --> 00:03:04,450 90. 48 00:03:04,470 --> 00:03:07,830 Maybe I didn't say 90 but maybe like 70 percent of the time. 49 00:03:07,830 --> 00:03:12,870 It's usually going to be caused by some bad import or export statement. 50 00:03:12,870 --> 00:03:18,180 Usually it's something like including curly braces when you shouldn't have curly braces which would 51 00:03:18,180 --> 00:03:21,390 be like you know if you put curly braces on all the reducer right here. 52 00:03:21,630 --> 00:03:22,990 Very common error to make. 53 00:03:23,250 --> 00:03:26,000 So do triple check that if you are seeing an error. 54 00:03:26,130 --> 00:03:31,170 Otherwise let's take a break continue the next section and talk about exactly what we're going to be 55 00:03:31,170 --> 00:03:35,340 doing with our Auth. reducer so I'll catch you in the next section.