When we create a store in Redux, we have access to get state function and as anyone wants to make a
wild guess what this function is doing, and I can give you a hint, the name describes everything that
the function is performing.
So you can probably already guess essentially with get state effectively, we're just going to get back
our state.
What is our initial state right now?
It is property count and the value of zero as it's going to be changing, of course, then we're going
to be returning the latest state.
Now, I also want to showcase that that is true.
Otherwise, you might be thinking that there's some sorcery involved.
So right below the store, I'm going to console my store, get state and let's invoke the function.
So now I have two things in a console.
Have the state in action coming from the producer.
And then, of course, I have my initial state.
And then just to showcase that, we could pass this to our components, we're just going to try it out
with a bar.
Keep in mind, of course, when we are going to be setting up our application, we will use the special
library for that to connect our Redock store to our application.
And the library name is React Redux.
But since we're just testing things out, I would still want to pass it down to a number so we don't
have the number.
I'm going to create a card prop and I'm going to send that card prop equal to store get state function.
So we pass it down as a prop.
Good.
Now, of course, we need to look for our Navar component.
And then since I passed that down, now of course I can access it.
I remember the name was Card.
Now we have few options.
Either I can access it directly because I know that it is an object or just to be more clear, I'm going
to destruction.
So I'm going to go with CONSED.
Then I'm looking for an account that is coming from my card prop.
So if I'm going to change the zero that is hard coded to my current prob, I should again still have
zero.
But now in this case we're going to have an option of changing our initial state and that should show
here all the way up on the top, on the right hand side.
So I'm going to head back to Objets and then remember our initial store.
If we set up everything correctly, then now we should have seventy eight, which we do because our
initial state is seventy eight.
And then of course since we passed that down to number, that's why it's represented right here.