So over the last lectures, we introduced redux and we're managing all the core state of our application
through it now.
Well I'm in the orders container and we don't manage orders through it right now because orders really is related
to asynchronous code and I want to handle fetching data and handling asynchronous actions with redux
first in the next module before we also use redux on this therefore. The same is kind of true for the
burger builder where previously we fetched the ingredients from the server,
we're not doing this right now,
we'll reintroduce this over the next lectures, over the next modules
but what we are doing is managing the core ingredients through redux. What I also already mentioned is
that for example in the contact data, we still have a lot of state in our state property,
the whole form is inside there,
the validity of our controls
and I want to really highlight, you can manage all of that through redux,
you can do that.
You can dispatch an action on every keystroke the user does and put all that logic you have in that container
here into redux so that you check the validity of controls in redux, that you update the form control
values through redux, that you have redux for everything,
you can absolutely do that,
and if you want to do this, really depends on the style you want to have in your application.
Do you want to have very lean components and containers?
This one here obviously isn't, then you have to put everything into redux. Do you want to have the state
management placed where it belongs?
So say this really is UI state,
it's only relevant in
this component and shouldn't be affecting any other components, then you might keep it in this container
here.
So this is really something you have to decide, both is correct,
it's certainly worth the exercise, the training to put all that state into redux with the knowledge
you have thus far
but for me, I'm happy with the current state of the application.
I want to move on in the next course module by diving into some more advanced things about redux like
handling asynchronous code and then coming back to this application to improve it even more.