Transcript
00:00 Let's start on the server right here and we're going to delete this stuff because the components that need this data are the ones that are going to go get it our Ship and search results are no longer there anymore And so let's dive into the app the app no longer needs the ships ship and ship results
00:17 So I'll get rid of that and what that means we no longer have the ship results here And rather than the ship we will need to pass the ship ID so that the ship details knows which ship to get so we'll pass The ship ID there instead and of course we want to make the syntax still work
00:32 So there we go. Let's dive into our search results now, and we're going to get our search ships utility from our database and We can get the ship results this way so we no longer get the ship results like that. We'll say ship results equals await search ships, we're going to make this an async function and
00:54 And look at that, isn't that nice I can just do whatever async things that I need and right where I need it I think that's a really really beneficial thing that typings for this will be a lot better We're not using TypeScript here, but in TypeScript this will be so much so much nicer and now if we go back here
01:13 We'll go to our ship details component. We're going to replace the ship with a ship ID We'll grab our get ship from the utils we'll make this an async function and we'll say our ship equals await get ship and We're yeah, we're solid. Let's take a look at this make sure it's still running and yes
01:32 It is indeed still running and all of our code is still working which is pretty awesome. I must say so in review all that actually, we didn't really change any behavior because Like ultimately the same UI is getting rendered and everything and we didn't change anything with our framework
01:50 it's just because of our framework the code of our Application is now able to use async await, and I just think that's pretty cool