All language subtitles for 081 useCallback - Fetch Example.en_US

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
fa Persian
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

And the last thing that I would want to showcase, just like I promised, there's another use case for

use called back, and that is essentially when we're fetching data.

And an awesome example is over here.

If we check the terminal, we can see that I have this morning where react use of fact has a missing

dependency get product either included or removed from dependency.

Right.

And of course, that is, in my custom, the use feature.

So let's say we'll navigate over there.

We have our custom hooks and then we have our use, which and I can see that the react is complaining

that, hey, listen.

You have got product function over here, so you need to add it as dependency, but before you jump

over it and add it as a dependency, let me warn you that you will create infinite loop y.

Well, let's see.

We have get products.

Correct.

And what is this get products doing.

Well it is calling set products so it sets the stage value which triggers the array render.

So if Al Gore here and you falsey get product is my dependency the first time I'll call the get product,

I'll change that value.

And then since this needs to rerun every time, of course, when we change something about this value

well, since get products once we added there, since it will get created from the scratch once we render,

that's why it will create a infinite loop, because again, the same scenario like we had or here with

index where we have the add to cart each and every time you render you create that function from scratch.

So if this gets added to dependency.

Right, technically each and every time when it gets created from scratch, well, you will render the

component.

Now in function, though, you'll also change the state value.

So you'll have that infinite loop.

And what is the solution?

Well, remember, we have our used callback, right?

So we can go here with use callback and then I can set it equal.

I can say use.

Knock over here what?

So let me wrap everything and now I need to say, well, one, I would want to create that function.

Of course, the answer is when I have a you are all changed.

So once the real change changes, yeah, please recreate that function from the scratch.

And of course, once we have this setup, I can bravely go to use fact and just add my get products

like me.

Reemphasize the point where previously before we added this huge callback, if we simply would add this

product, we would get a infinite loop.

Why?

Because of this would get created each and every time.

Now we only create a new function once the euro changes.

And of course, as a result, we're not getting this infinite loop.

So that would be another use case for use callback hoc.

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