1
00:00:07,930 --> 00:00:13,030
In this video, let me show you what is called action type constant.

2
00:00:13,390 --> 00:00:19,180
Even though our logic is perfect, but we are prone to some arrows.

3
00:00:19,210 --> 00:00:20,740
Let me show you what I mean here.

4
00:00:20,830 --> 00:00:26,020
Inside the action, that is the context and for the of context.

5
00:00:26,020 --> 00:00:28,210
And here we go.

6
00:00:28,810 --> 00:00:38,670
In case I mistakenly provide log in success with additional s or with one s when I save this one.

7
00:00:38,680 --> 00:00:40,050
And now let's try it.

8
00:00:40,060 --> 00:00:40,950
Log in.

9
00:00:40,960 --> 00:00:42,940
Let me open the console.

10
00:00:42,970 --> 00:00:52,300
Let me clear this one and now let me provide right credentials as Adam at Gmail dot com with a password.

11
00:00:52,300 --> 00:00:53,820
One, two, three, four, five.

12
00:00:53,830 --> 00:00:55,930
And now let me hit send.

13
00:00:56,690 --> 00:00:57,650
Look here.

14
00:00:57,680 --> 00:01:00,500
Nothing is seen to be displayed.

15
00:01:01,040 --> 00:01:06,770
But if I provide wrong credentials, let's see what I'm going to get.

16
00:01:07,140 --> 00:01:07,820
Hey, that's.

17
00:01:07,820 --> 00:01:14,660
And you can see that I have invalid login credentials, but for the success, I didn't see the success

18
00:01:14,660 --> 00:01:16,030
with the log in details.

19
00:01:16,040 --> 00:01:17,360
Why is it so?

20
00:01:17,780 --> 00:01:24,630
It is so because of the differences of the type inside the reducer.

21
00:01:24,680 --> 00:01:29,450
There is no action type with this log in success.

22
00:01:29,630 --> 00:01:38,240
So to avoid this kind of calamities or problems, that is why we need what is called action constant.

23
00:01:38,330 --> 00:01:42,440
So here we go inside the off.

24
00:01:42,920 --> 00:01:46,390
Remember, we add that the action type.

25
00:01:46,400 --> 00:01:53,380
So we are going to export all the action types that you may need for our project.

26
00:01:53,390 --> 00:02:03,530
So here I'll call this one as log in action types and you may need to file action type.

27
00:02:03,560 --> 00:02:10,070
You may need the registration, registration or register action type.

28
00:02:10,070 --> 00:02:17,840
So here we go now going to export const and then log in.

29
00:02:18,470 --> 00:02:28,670
Success is equal to log in, underscore success and for error.

30
00:02:28,670 --> 00:02:39,950
I will copy this one and here is going to be as log in failed or failure and I'll provide the same name

31
00:02:39,950 --> 00:02:44,870
here and start now inside my reducer.

32
00:02:44,870 --> 00:02:47,480
I'm going to require that file.

33
00:02:47,480 --> 00:02:52,790
So here I would need the log in action type and success.

34
00:02:52,790 --> 00:02:55,040
You can see that I have required it here.

35
00:02:55,430 --> 00:03:04,250
So instead of this one I will go ahead and then replace log in success and this one is more secured.

36
00:03:04,250 --> 00:03:10,040
So here I need to structure that one also as log in failed.

37
00:03:10,040 --> 00:03:15,440
So down here let's remove that and make use of log in failed.

38
00:03:15,440 --> 00:03:18,770
So this are the action constant I was referring to.

39
00:03:19,160 --> 00:03:22,850
So here I'm going to provide all the action types for you.

40
00:03:22,850 --> 00:03:26,180
We are going to handle for register for looking.

41
00:03:26,180 --> 00:03:29,960
We are done with it and for profile and for updates.

42
00:03:29,990 --> 00:03:30,560
Great.

43
00:03:30,560 --> 00:03:39,020
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

44
00:03:39,020 --> 00:03:40,070
we can update.

45
00:03:40,070 --> 00:03:40,640
All right.

46
00:03:40,640 --> 00:03:42,860
Let's get into that in the next video.

