You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: day-20/post.md
+16-10Lines changed: 16 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -40,6 +40,8 @@ As a refresher, an action is a simple object that _must_ include a `type` value.
40
40
41
41
```javascript
42
42
exportconstFETCH_NEW_TIME='FETCH_NEW_TIME';
43
+
exportconstLOGIN='USER_LOGIN';
44
+
exportconstLOGOUT='USER_LOGOUT';
43
45
```
44
46
45
47
As a quick review, our actions can be any object value that has the `type` key. We can send data along with our action (conventionally, we'll pass extra data along as the `payload` of an action).
Now if we call this function, _nothing_ will happen except an action object is returned. How do we get this action to dispatch on the store?
@@ -89,7 +82,7 @@ Recall we used the `connect()` function export from `react-redux` yesterday? The
89
82
Let's see this in action. In our `src/views/Home/Home.js` file, let's update our call to connect by providing a second function to use the actionCreator we just created. We'll call this function `mapDispatchToProps`.
0 commit comments