All language subtitles for 011 Understanding Actions_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
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

In this lecture, we're going to take a step back to discuss designing our state.

The reason we're going to discuss this topic is because we're going to refactor our code with actions.

We've successfully registered and authenticated the user.

The code we've written is isolated in a single component.

In some cases, you may want to register a user in multiple locations.

For example, you may build an admin interface for managing the application.

This admin interface may include a feature for creating accounts.

It isn't uncommon to build such a feature in those cases.

It would make sense to make the code more reusable.

Currently, if we wanted to create an account in another part of the application, we'd have to rewrite

a lot of the code.

Pernia comes with a solution called actions.

Actions are functions for outsourcing business logic in the store.

Simple as that we can define functions in a store.

These functions will become available to all components.

If you are familiar with View X, Peneha has a different approach to actions.

From actions we can perform mutations.

This feature is completely different from other state management libraries where mutating the state

is disallowed.

There are advantages to using actions.

Firstly, they are available to all components in the register form components.

Any methods defined in the configuration options are isolated to the components.

They can't be used elsewhere unless we pass down the methods as props.

By using actions, they can be exposed to any component.

Another advantage is that actions can be asynchronous.

Since actions are not logged, there isn't a reason to keep track of them.

Lastly, actions can commit multiple mutations.

This can help reduce the amount of code you have to write.

One last thing before we get into writing action functions, I want to make it clear as to when you

would want to define an action instead of defining a method inside a component.

Here's a general rule of thumb If a code you write will affect the state, you'll want to write it as

an action, otherwise, define it as a method for the component.

For this reason, we're going to refactor the code we've written for the registration form.

We'll start the refactoring process in the next lecture.

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