All language subtitles for 027 Wrap Up_en

af Afrikaans
ak Akan
sq Albanian
am Amharic
ar Arabic
hy Armenian
az Azerbaijani
eu Basque
be Belarusian
bem Bemba
bn Bengali
bh Bihari
bs Bosnian
br Breton
bg Bulgarian
km Cambodian
ca Catalan
ceb Cebuano
chr Cherokee
ny Chichewa
zh-CN Chinese (Simplified)
zh-TW Chinese (Traditional)
co Corsican
hr Croatian
cs Czech
da Danish
nl Dutch
en English
eo Esperanto
et Estonian
ee Ewe
fo Faroese
tl Filipino
fi Finnish
fr French
fy Frisian
gaa Ga
gl Galician
ka Georgian
de German
el Greek
gn Guarani
gu Gujarati
ht Haitian Creole
ha Hausa
haw Hawaiian
iw Hebrew
hi Hindi
hmn Hmong
hu Hungarian
is Icelandic
ig Igbo
id Indonesian
ia Interlingua
ga Irish
it Italian
ja Japanese
jw Javanese
kn Kannada
kk Kazakh
rw Kinyarwanda
rn Kirundi
kg Kongo
ko Korean
kri Krio (Sierra Leone)
ku Kurdish
ckb Kurdish (Soranรฎ)
ky Kyrgyz
lo Laothian
la Latin
lv Latvian
ln Lingala
lt Lithuanian
loz Lozi
lg Luganda
ach Luo
lb Luxembourgish
mk Macedonian
mg Malagasy
ms Malay
ml Malayalam
mt Maltese
mi Maori
mr Marathi
mfe Mauritian Creole
mo Moldavian
mn Mongolian
my Myanmar (Burmese)
sr-ME Montenegrin
ne Nepali
pcm Nigerian Pidgin
nso Northern Sotho
no Norwegian
nn Norwegian (Nynorsk)
oc Occitan
or Oriya
om Oromo
ps Pashto
pl Polish
pt-BR Portuguese (Brazil)
pt Portuguese (Portugal)
pa Punjabi
qu Quechua
ro Romanian
rm Romansh
nyn Runyakitara
ru Russian
sm Samoan
gd Scots Gaelic
sr Serbian
sh Serbo-Croatian
st Sesotho
tn Setswana
crs Seychellois Creole
sn Shona
sd Sindhi
si Sinhalese
sk Slovak
sl Slovenian
so Somali
es Spanish
es-419 Spanish (Latin American)
su Sundanese
sw Swahili
sv Swedish
tg Tajik
ta Tamil
tt Tatar
te Telugu
th Thai
ti Tigrinya
to Tonga
lua Tshiluba
tum Tumbuka
tr Turkish
tk Turkmen
tw Twi
ug Uighur
uk Ukrainian
ur Urdu
uz Uzbek
vi Vietnamese
cy Welsh
wo Wolof
xh Xhosa
yi Yiddish
yo Yoruba
zu Zulu

Original subtitles

Now, I know that especially does custom hook thing can be confusing also because we built a quite complex

custom, OK, here, you can definitely have simpler ones than this one.

But I want to show one where you can learn a lot.

The idea of custom hooks is that you share logic, not data.

So what we do here is we share logic that we use in both to search animals in the ingredients component.

And when we send the request in ingredients, this doesn't do anything and search and the other way

around as well.

This is how it should be.

You're able to share stateful logic across components and it is stateful because are a custom hook.

We're using use reducer to manage some state.

And when we dispatch a new action here, does actually triggers react to rebuild the component, but

we use the hook.

So we're not having a regular JavaScript function here, but a function where we can do certain things

that will lead react to rebuild the component in which we're using this function, this hook.

That's the ideal hooks.

And while custom hooks can be confusing at first, they can be very powerful because we were able to

move all of that age to the P logic out of this component.

And instead we just send off some requests and we handle the responses and use effect.

And that, of course, all does a pattern you have to get used to.

Normally you would expect send request to return a promise and then use then or async a way to handle

this.

And you could do it as by the way, you could absolutely have send request, return a promise here.

It's not for turning anything.

While we could, of course, return the result of fetch and now send request would all of a sudden return

a promise.

You could do that and you would be able to implement this in a totally different way.

You would be able to simply listen to the response here.

And handle the response here instead of using it or doing it and use effect this split into a place

where you send it and then use a fact where you handle it can be especially confusing at first.

But this actually embraces hooks and uses their full potential because I believe it's a very clean code

in the end, where we have a clearly defined place, where we change some data in our component here.

And we could have multiple use effect called, of course, if we have multiple side effects.

So we have a clearly defined place where we do that and we have another place where we dispatch our

actions, so to say where we send our requests.

Again, it is something that certainly takes time getting used to.

It's not a must do.

You could return a promise and use your regular flow.

But I think this split is very nice, very clean.

And most importantly, does overall use of a custom hook and of hooks in general allows us to write

a very clean code with clear responsibilities, which can be challenging at first, but which ultimately

will allow you to write better, cleaner and probably also better performing applications.

Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.