All language subtitles for 043 useState - Multiple State Values.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 Download
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

All right, that is clear, but as you're looking at our setup, you're probably wondering, OK, but

why do we have to even bother with an object in the first place?

Can we set up three separate state values and then whichever we would want to change, of course, we

would use that handler method.

Well, let's try it out.

But I can right away spare you the cliffhanger and said, yeah, that is essentially what you can do.

So in here I'm going to go name and set name.

So I'm going to be somewhat original where I'm not going to go with a wild name for my handler function.

And then again, I'm looking for the same thing, Peter, and then I'll just copy and paste and will

change these values around where now we have age and then we're looking for a set edge and the value

will be 24.

And then the last one, of course, is going to be my message.

So we're going message set message.

That is going to be my function online.

As far as the original value.

When we passed in here, we set random message.

Now, of course, in this case, we are not dealing with objects anymore.

So we have these state values.

So one by one, of course, we will need to access them.

So now I'm looking for a name that I'm looking for a person.

And then lastly, I'm looking for a message.

And when we talk about this change message, well, we can either right away call set message here on

click.

So remember that, of course, we'll have to set up the in line because we're passing in the argument

or since we already have the handler, I can simply pass here and say set and then message and we would

want to change it, of course, to a analog world.

So once we set that up.

Now, once you click course, I have my value.

So essentially what I'm trying to say that there is no rule that prevents you from setting up as many

state values as you would want.

So instead of going for one giant object, you can set up multiple smaller state values where you have

just a single value and a function that controls it.

Or if you do decide, going with an object.

And there's going to be some use cases where object might make a little bit more sense than always,

always, always.

Remember that you need to make sure that you preserve these old values.

And a nifty way of doing that is using a separate operator where essentially we copy the properties

from the previous object and then we just choose whichever we would want to override.

And of course, in this case it was a message.

So we went from random message to a hell of world power.

Yes, there is an alternative where you can set up as many state values as you would want just by calling

your state.

You state passing in default value and then you have that single state value as well as the handler

function for that step value.

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