All language subtitles for 010 Custom Hook Store Summary_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

So what we built here in the end is our custom redacts like story implementation, we're having some

variables which are not global, not registered on the window object, but which do exist in this file

here.

And they only exist once in our application lifetime.

So they're shared in the entire application, every module.

So every other file which imports from the stored jazz file will use the same values which are stored

here.

Then in the same file, we create our own custom hook.

These variables are defined outside of the hook, though, and that's an important thing, because if

they were defined inside of the hook, then every component that used this hook would use its own values,

since they're to find outside of the hook every component that uses our custom hook uses the same values.

So now we're not just sharing the hook logic, but also some share data.

And sometimes you don't want this here.

We absolutely do want this because this allows us to globally manage some state, some actions and listeners

which are interested in state changes, which in turn are triggered by actions in our use store hook.

We're managing all of that.

We're having our dispatch function in there, which makes sure that whenever we call dispatch, we update

our global state and we call our listeners where our listeners are in and just said state calls where

we abuse in quotes because it's not really a hack.

But we're simply using that feature that when you call that state updating function use state gives

you any component that uses this hook will render.

That's what we want here.

We register one listener per component with the help of USA Fact, and we unregister it when that component

is destroyed.

And we then also have a way of initializing our store, which you can call multiple times because we're

not replacing our global state or replacing our actions.

Instead, we're always taking the current global state and the current actions to map to emerging new

data.

We're doing this so that you can create concrete store slices, just as we're doing it with redux,

with multiple reducers, where in one slice you manage your products, maybe in a narrow slice you managed

to use authentication status.

Of course, you have to make sure you avoid name clashes, but that's all.

So here I'm then setting up some actions.

For example, one action, of course, only here.

And then we call in its store to pass our actions here and our initial state for this slice of the global

state.

So that will be merged in our global state and in our global actions map.

And then from anywhere in our project, we can use that store and then ever tap into our state or use

the dispatch function to dispatch an action.

That's the idea here.

That's roughly kind of also the idea how Redox works behind the scenes.

But now we rebuilt it totally without redacts saving that extra dependency and using react and hooks

only.

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