1 00:00:00,650 --> 00:00:03,850 In less video we added in a ton of boilerplate to our project. 2 00:00:03,950 --> 00:00:08,570 But as we saw we're still getting this air around the fact that we do not have reducers folder or an 3 00:00:08,570 --> 00:00:10,390 index such as file inside there. 4 00:00:10,490 --> 00:00:12,450 So let's take care of that very quickly. 5 00:00:12,530 --> 00:00:19,130 Back inside my SIRC folder I'll make a new folder called reducers and inside of there I'll make a new 6 00:00:19,130 --> 00:00:22,100 file called the index such as file. 7 00:00:22,100 --> 00:00:30,560 So as we've seen previously we can import combine reducers from redux and then we can export default 8 00:00:30,830 --> 00:00:34,970 combine reducers and we'll pass that thing and object. 9 00:00:34,970 --> 00:00:39,440 Now at present we have nothing to put inside this object because we don't have any reducers inside of 10 00:00:39,440 --> 00:00:40,460 application. 11 00:00:40,460 --> 00:00:45,740 Sure we'll talk about what reducers we need in just a moment but we don't have any reducer whatsoever 12 00:00:45,740 --> 00:00:46,420 to put in here. 13 00:00:46,430 --> 00:00:47,660 As it stands. 14 00:00:47,680 --> 00:00:51,730 So let's just try saving the file as is and see if our application works now. 15 00:00:53,220 --> 00:00:58,650 I flip back over I'll see that while my text is displaying here on the screen. 16 00:00:58,670 --> 00:01:00,380 You know I see that Aztec's to appear. 17 00:01:00,470 --> 00:01:05,710 I can open up my console and unfortunately I'm getting a little kind of warning message here. 18 00:01:05,810 --> 00:01:07,900 Really I would call this an error not a warning. 19 00:01:07,940 --> 00:01:11,820 It only appears to be kind of a warning because our application still appeared on the screen. 20 00:01:11,870 --> 00:01:13,470 But this definitely is an error. 21 00:01:13,700 --> 00:01:17,320 So the air here says that our store does not have a valid reducer. 22 00:01:17,450 --> 00:01:18,890 And hey that totally makes sense. 23 00:01:18,890 --> 00:01:23,840 We called Combined reducers but we don't have any reducers to pass to it just yet. 24 00:01:23,840 --> 00:01:28,340 So it turns out that this happens rather frequently when you're first getting started on any given redux 25 00:01:28,340 --> 00:01:29,480 project. 26 00:01:29,480 --> 00:01:33,710 You might start up the project put together some boilerplate but you don't know what reducers you're 27 00:01:33,710 --> 00:01:34,460 going to need. 28 00:01:34,460 --> 00:01:38,630 So you just kind of want get your application working and get that error message to go away. 29 00:01:38,750 --> 00:01:43,020 You might eventually come back and add in some reducers which would solve the problem but maybe for 30 00:01:43,050 --> 00:01:46,190 right now we don't really want to work on the reducers inside of our app at all. 31 00:01:46,190 --> 00:01:50,520 Maybe we want to work on the Riak side of the project or something like that. 32 00:01:50,540 --> 00:01:53,950 So as a little work around there's a tiny little trick that we can do here. 33 00:01:53,960 --> 00:01:55,880 I would barely even call it a trick. 34 00:01:55,970 --> 00:02:02,150 Inside the combined reducers call I can put in some dummy key like some dummy variable you can be total 35 00:02:02,150 --> 00:02:08,170 jibberish like that if I want to it can be literally the word dummy or even something like replace me. 36 00:02:08,330 --> 00:02:14,060 And then we can assign a dummy key an arrow function that is always going to return some fixed value. 37 00:02:14,060 --> 00:02:18,110 Like maybe the number 10 or the number 9 9 9 or the string. 38 00:02:18,110 --> 00:02:19,450 Hi there. 39 00:02:19,580 --> 00:02:21,290 There's no purpose to this thing right here. 40 00:02:21,320 --> 00:02:25,120 It's just tricking redux into thinking that it has a valid reducer. 41 00:02:25,250 --> 00:02:26,150 That's it. 42 00:02:26,210 --> 00:02:29,380 And the only reason we're doing this is to get that error message to go away. 43 00:02:29,630 --> 00:02:33,650 Like I said anytime you start up a redux project you're probably going to want to do something like 44 00:02:33,650 --> 00:02:39,140 this very briefly until you get a really good idea of how to structure your reducers in what reducers 45 00:02:39,140 --> 00:02:40,500 you're going to need. 46 00:02:40,520 --> 00:02:45,110 So now that I've got the dummy producer inside of here I can flip back over the error message has gone 47 00:02:45,110 --> 00:02:45,830 away. 48 00:02:46,310 --> 00:02:51,950 So now we are free to work on all the different other aspects of our application such as enhancing some 49 00:02:51,950 --> 00:02:55,760 Riak components or maybe creating some action creators or whatever it might be. 50 00:02:55,850 --> 00:03:00,480 And we don't have to worry about the fact that redux is just refusing to play ball. 51 00:03:00,510 --> 00:03:04,440 So now we've kind of got some leverage here and we could start working on anything that we want now 52 00:03:04,450 --> 00:03:08,670 to be honest Republican to start working on the reducers first but hey that's just life. 53 00:03:08,670 --> 00:03:12,530 I just want to show you this little thing that you can do to get that your message to go away. 54 00:03:12,540 --> 00:03:15,620 All right let's take another quick pause right here and we'll continue in the next section.