 Saya rasa saya Rd 7. Rd 7? Sekarang? 0-0. 0-0. Okey. Sampai jumpa lagi. Okey. Hai. Okey. Hai, semua. Kita akan bercakap tentang cash hari ini. Okey. Jadi, ada sesuatu tentang saya dulu. Nama saya Ishu. Ini adalah twitter saya, handler saya. Saya suka kopi. Saya baru tahu apa yang saya nampak. Jadi... Saya akan menyeronokkan masa saya dari sekarang. Okey. Jadi ini bermula dengan... Saya mengambil panggilan dengan Khaled. Kemudian, kita bercakap tentang bagaimana... Dia sangat lapar dengan menggunakan Redux. Kemudian dia berkata, Saya sangat lapar. Saya ingin beritahu semua orang yang bermain. Kenapa tidak kita hanya panggil Fetch? Apa yang kita buat? Kenapa tidak kita hanya panggil Fetch? Kemudian dia bermula bercakap tentang... Ketika kita menggunakan... Mungkin kita tidak akan menggunakan Redux lagi. Jadi... Pada saat ini saya bermula... mencari tentangnya. Jadi, 5 perkara. Pertama. Ia ada disebabkan keadaan kita. Jadi... keadaan itu adalah sesuatu yang sudah diberikan. Jika anda menggunakan keadaan, anda mungkin sudah menggunakan keadaan. Anda boleh menggunakan keadaan. Ketika anda menggunakan keadaan kita. Ketika anda menggunakan keadaan. Adakah itu sesuatu yang diberikan? Ya. Jadi... Ini seperti keadaan 30. Anda dapat sebenarnya menggunakan keadaan. Kemudian... Ada perkara yang anda boleh beritahu. Sebelum kita menggunakan keadaan. Ada 4 perkara yang anda boleh menggunakan. Jadi... Pada masa yang lama saya selalu... memikirkan keadaan itu... bermaksud... Komponan anda... Bersendirikan keadaan anda. Atau anda akan mendirikan keadaan. Apabila saya melalui Twitter, saya merasa... keadaan itu... sebenarnya lebih keren daripada itu. Seperti... ia sebenarnya membeli... rendahkan konten. Jadi, kita kata... jika anda bergerak dari... keadaan anda... ke keadaan anda, itu bukan... ia bergadu ke keadaan anda. Dan kemudian ia memperkenalkan keadaan. Apa yang ia melakukan... adalah ia sebenarnya menunggu sekejap. Anda menunggu sekejap... untuk keadaan anda. Kita kata anda sudah memasakkan keadaan anda. Sudah diberikan keadaan anda. Kemudian ia bergadu ke keadaan anda. Jadi, keadaan itu... ia berpenggabung selama sekejap. Ia memiliki sekejap... sebelum ia melewati keadaan yang berikutnya. Yang ia seperti... waw... Jadi, saya rasa... ia bukan... ia mempunyai... jadi, jika anda memasakkan keadaan anda... untuk tanda-tanda berbentuk... untuk memasakkan keadaan anda... ia seperti... anda memasakkan keadaan anda... untuk satu kawasan. Kemudian ia akan... menghubungkan keadaan yang lain. Jika kita boleh menghubungkan keadaan anda... kita mesti menghubungkan untuk lebih banyak keadaan anda. Jadi, saya rasa... itu adalah proses yang terbaik. Jadi, itu sebenarnya apa yang dipanggil Reaction Cash. Ia masih tak stabil. In case you think this is a library, it's not a library. It's part of the React library itself. It's not a separate library. But it's still not stable. If you want to try it, you can try it now. And it's not because the Reacting is lazy. So, if you go to the repo, it's actually part of the React repo package Reaction Cash. I tell you, no, it's really unstable. But then, we can have a demo now. So, let's look at how I look back first. I have only refreshed. So, it will actually call an API to get my Pokemon. It will come back. And then, if I render... You see that actually more of the component that I render, it doesn't make the fetch anymore. Fetch. Subsequent render, no fetching. So, let's take a look at the code. So, over here I have a fetch. I have a function called getBrowersaw. And then getBrowersaw, it actually just fetch. I do a bit of weird stuff because I realize my internet is quite fast. So, after my promise come back, I will make it wait for 3 seconds before I resolve it. That's why, at the side, you can see it's a bit longer. And then, this is where the magic comes in. Create resource. My create resource will call this fetch function that I have. So, over here, is this my actual... So, my app, there's nothing else other than it's trying to render many, many copies of this Pokemon component. And this Pokemon component has this line where it tries to fetch the data. So, what happened here is that React is actually trying to cache what I'm asked for. It knows that when I do a subsequent call to this fetch again, it's really in the cache already. So, when I render more and more of my component, it actually can go and find inside the cache and be able to find like my data has been fetched. Okay. So, it can replace Redux in certain situation. If you are using Redux for just one thing, which is data fetching, you are going to go to endpoint to a fetch. When it comes back, you saw in your saw. The next time when you need it again, you look at your saw, then your saw got the information you use it. If you... The one you can invalidate it. Yes. If you are doing only that for Redux, actually, React Cache can replace what you are using Redux for. But then, there are a lot of other things you can do with Redux. Like, for example, after you fetch data you put in your saw, sometimes you have to mutate it. Like, let's say, your website will render a lot of these things. Then, when a user likes a listing, he want to change the light to color, then you need a way to keep it at the central saw and that's not the React Cache that you have. So, if you are doing more things to your data other than fetching, then probably you will still need Redux. Okay, so, this goes to the mechanism. How does it work? Okay, so, I found this really good example. Okay. Okay, so, this is my Pokemon component. Maybe it has many, many nested layer. Maybe the page have my Pokemon component. This is Suspense, which is the boundary that you put around what you want to suspend. So, over here, it tries to trigger a fetch. Don't have, it will suspend itself. And then, it will actually go through all the layer until it hits your boundary. So, your boundary is the one that actually tries to do the data fetch. And then, it will tell your component that it can render already. Ya. So, okay, so, I will call it this later. Then, actually, I'm still trying to wrap my head around what this thing is trying to do. But then, what happens is actually for real cache is that it throws a fetch. It throws a promise out. So, usually we do throw, try catch throw. The throw, we usually throw an error. And then, the closest layer of catch will catch it. But then, but then, we haven't realized it. But then, we can actually throw other stuff. We can throw the whole window. We can throw functions. We can throw a string. We can throw a promise also. So, just now, my Pokemon layer, is that it threw a promise out. And then, the suspend layer managed to catch it and fetch it for me. Okay. It's no 0.5 because I missed out. Okay. Thank you.