In this video, let me show you what is called action type constant.
Even though our logic is perfect, but we are prone to some arrows.
Let me show you what I mean here.
Inside the action, that is the context and for the of context.
And here we go.
In case I mistakenly provide log in success with additional s or with one s when I save this one.
And now let's try it.
Log in.
Let me open the console.
Let me clear this one and now let me provide right credentials as Adam at Gmail dot com with a password.
One, two, three, four, five.
And now let me hit send.
Look here.
Nothing is seen to be displayed.
But if I provide wrong credentials, let's see what I'm going to get.
Hey, that's.
And you can see that I have invalid login credentials, but for the success, I didn't see the success
with the log in details.
Why is it so?
It is so because of the differences of the type inside the reducer.
There is no action type with this log in success.
So to avoid this kind of calamities or problems, that is why we need what is called action constant.
So here we go inside the off.
Remember, we add that the action type.
So we are going to export all the action types that you may need for our project.
So here I'll call this one as log in action types and you may need to file action type.
You may need the registration, registration or register action type.
So here we go now going to export const and then log in.
Success is equal to log in, underscore success and for error.
I will copy this one and here is going to be as log in failed or failure and I'll provide the same name
here and start now inside my reducer.
I'm going to require that file.
So here I would need the log in action type and success.
You can see that I have required it here.
So instead of this one I will go ahead and then replace log in success and this one is more secured.
So here I need to structure that one also as log in failed.
So down here let's remove that and make use of log in failed.
So this are the action constant I was referring to.
So here I'm going to provide all the action types for you.
We are going to handle for register for looking.
We are done with it and for profile and for updates.
Great.
So now that we are able to log in, I think we can work on the profile and how we can look out and how
we can update.
All right.
Let's get into that in the next video.