All language subtitles for 008 Creating a Concrete Store_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 in the bookstore, I'll now add a product stash store, Jaspal, of course, you can name this whatever

you want and here I'll import in it store from the store, Jaspal.

Now you're all to configure a store function, which is not getting any arguments, but where we can

now set up our actions and our initial state and then I'll call in in its store and passed it data to

it.

So the first thing is my actions, and that should be an object.

And now here you have some identifiers like, let's say toggle fav.

That's a property name here.

And the value, as I mentioned earlier, should be a function where you get your current state, so

Curre state.

And you return the part of the state you want to update.

So here I return.

And new object with a product key, because you're a plan on updating the products.

Where I get my curse state products.

And keep in mind, that state always is this global state thing, which could manage different kinds

of state.

But the way we set up this despatching is that we will update the global state with our return value

of when we call our action, but merged it with the existing states.

So here we only have to return what we want to change.

And here I want to return a new object with a product key because I want to change my products with

current state products.

But of course, now here I want to switch to favorite status, so I'll use the same logic as before,

which we already set up multiple times, for example, here in the products context file in there.

It's this logic here for creating an updated list of products.

So do that in here, and current product list is now simply current state dot product, so that's our

current list of products.

So let's replace all of that with current state products and the product I.D. here.

That's, of course, something we all need.

So actually, we should alter this action here and not just expect the global state.

But you're also a product I.D., let's say, so that we can use that here to then here I return my products.

Key with updated products as a value now this is my actions object, and we'll have to make sure that

this I.D. thing is handled soon.

But now, for now, the syste actions object and now in its store can be called by forwarding our actions

object, which will be registered in our global actions, object in the store.

And then an initial state where I also want to have some products.

And their products, of course, can be taken from the products context file.

It's this array of products.

Let's copy it from there and move it into the product store file here as an array.

So now we have that file which initializes our store with our actions and our starting state, our starting

object with our starting list of products.

Now I will export this configure store function where all of this is happening.

So this function here so we can use it.

And let's briefly go back to the storage as followed and also make sure that when an action is dispatched

and we forward the global state, we also can forward any value, any payload that is passed along with

the action.

So here to dispatch function should not just be getting an action identifier, but also, let's say

a payload so that we can forward that payload to our action function as well.

And payload can now be an object or just a string number, whatever you need.

And for example, that allows us to set up action here in the product store file where we expect to

get a product that would be the payload.

We then have to pass along when we call dispatch.

And that's the missing thing.

We said all of that up, but we're not using our custom store here.

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