Afrikaans
Akan
Albanian
Amharic
Arabic
Armenian
Azerbaijani
Basque
Belarusian
Bemba
Bengali
Bihari
Bosnian
Breton
Bulgarian
Cambodian
Catalan
Cebuano
Cherokee
Chichewa
Chinese (Simplified)
Chinese (Traditional)
Corsican
Croatian
Czech
Danish
Dutch
English
Esperanto
Estonian
Ewe
Faroese
Filipino
Finnish
Frisian
Ga
Galician
Georgian
German
Greek
Guarani
Gujarati
Haitian Creole
Hausa
Hawaiian
Hebrew
Hindi
Hmong
Hungarian
Icelandic
Igbo
Indonesian
Interlingua
Irish
Italian
Japanese
Javanese
Kannada
Kazakh
Kinyarwanda
Kirundi
Kongo
Korean
Krio (Sierra Leone)
Kurdish (Soranรฎ)
Kyrgyz
Laothian
Latin
Latvian
Lingala
Lithuanian
Lozi
Luganda
Luo
Luxembourgish
Macedonian
Malagasy
Malay
Malayalam
Maltese
Maori
Marathi
Mauritian Creole
Moldavian
Mongolian
Myanmar (Burmese)
Montenegrin
Nepali
Nigerian Pidgin
Northern Sotho
Norwegian
Norwegian (Nynorsk)
Occitan
Oriya
Oromo
Pashto
Persian
Polish
Portuguese (Brazil)
Portuguese (Portugal)
Punjabi
Quechua
Romanian
Romansh
Runyakitara
Russian
Samoan
Scots Gaelic
Serbian
Serbo-Croatian
Sesotho
Setswana
Seychellois Creole
Shona
Sindhi
Sinhalese
Slovak
Slovenian
Somali
Spanish
Spanish (Latin American)
Sundanese
Swahili
Swedish
Tajik
Tamil
Tatar
Telugu
Thai
Tigrinya
Tonga
Tshiluba
Tumbuka
Turkish
Turkmen
Twi
Uighur
Ukrainian
Urdu
Uzbek
Vietnamese
Welsh
Wolof
Xhosa
Yiddish
Yoruba
Zulu
In the last lecture, we have worked on the changes in our story in this lecture will continue with
further improvements.
Let's start in earnest or index dogs and let's inspect what we are doing currently.
When we get to the exchanges, we are setting time out to one second after one second.
We are getting the state of the exchanges and there are setting them to our exchanges right to their
values.
What I would like to change here, I would like to separate to this step of the state exchanges to its
separate function.
OK, in the view, which is nicely modular package, we can separate every step of the functionality.
We can have a separate functionality to get exchanges, and we can have a separate functionality to
set of exchanges to the state.
OK, so everything is nicely modular, everything is nicely testable, and we can easily easier to find
issues in our code.
OK, so.
A part of the action here.
You have something called mutations.
Mutations like this, you know, specify your object and enter this object.
You can specify your mutations functions.
In this case, my mutations function will be to set up exchanges to send them to the state, so we will
separate state here, upsetting of the exchanges of the state into the mutation.
OK, so usually you are calling these functions you are fixing with a set such as, for example, set
exchanges.
All right.
I specified as a normal function.
Mutations are special mutations that they are receiving, not the entire context as they are, but they
are receiving higher states, so the first parameter here will be always state.
And the second parameter here will be the any value and a payload you will send through the comment
function, but I will show you a into in a second.
So remember, in the mutations, you will always have a first value, the state, a second value is
your custom value.
You can decide what it's going to be.
So in this case, we can parse here data and you can call it data or we can call it normally exchanges.
OK.
And since we have a state here, we can just do this exactly the same thing, what we have done here,
state exchanges, equal exchanges.
This way, I don't think, but because they're a state to manipulate a state here at all I can is something
called comet.
OK, I gave him the context to me because we can see that comet function comet like this.
So as we have learned so far, we have a context here, context and for context, the color of a state
and also comet.
Now they are working with a comet, and in the comet, he will specify following a comet.
Any little specified here the name of your mutation you would like to call.
In this case, we would like to call set exchanges and the payload you would like to send, and that
will be the exchanges here when our data exchanges here.
And that's the entire functionality.
So not much change, guys.
But if it changes, like with architecture, yes, you know, separating the setting of a state and
the getting of that state.
So after one second, here we are executing at a comet.
We would like to call this at exchanges and passing the payload of the exchanges.
These will execute mutations whatever you directly will pass.
For us here as state exchanges, we are positioning ourselves as we want.
Of course, you can collect data, we can call it early and call it the list of exchanges, whatever
you prefer here.
And then if you will look at the hard data and then it will send the data here.
But I would like to call it exchanges.
OK, and the same step here we're getting we are setting the exchanges to exchanges so many of us to
go to your browser refresh after one second.
The time of the one second you will receive your exchanges.
And that's basically to just a just a small refactor.
So you will learn how to use these things and you look at professional and as you will see in the end
of the course, because we'll be using it heavily.
So guys, let's see what the next well.
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.