Skip to content

Commit 6968b93

Browse files
author
Ari
committed
Updates day-20/8 posts for typos
1 parent d6e104d commit 6968b93

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

day-20/post.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,15 @@ What we _want_ is the ability for our users to update the time by clicking on a
3434

3535
We already implemented the third step, so we only have two things to do to get this functionality working as we expect.
3636

37-
Yesterday, we discussed what actions are, but not really why we are using this thing called actionCreators or what they are.
37+
Yesterday, we discussed what actions are, but not really why we are using this thing called actionCreators or what they are.
3838

3939
As a refresher, an action is a simple object that _must_ include a `type` value. We created a `types.js` file that holds on to action type constants, so we can use these values as the `type` property.
4040

4141
```javascript
42-
xport const FETCH_NEW_TIME = 'FETCH_NEW_TIME';
42+
export const FETCH_NEW_TIME = 'FETCH_NEW_TIME';
4343
```
4444

45-
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).
45+
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).
4646

4747
```javascript
4848
{
@@ -51,7 +51,7 @@ As a quick review, our actions can be any object value that has the `type` key.
5151
}
5252
```
5353

54-
Now we need to _dispatch_ this along our `store`. One way we could do that is by calling the `store.dispatch()` function.
54+
Now we need to _dispatch_ this along our `store`. One way we could do that is by calling the `store.dispatch()` function.
5555

5656
```javascript
5757
store.dispatch({
@@ -60,7 +60,7 @@ store.dispatch({
6060
})
6161
```
6262

63-
However, this is pretty poor practice. Rather than dispatch the action directly, we'll use a function to return an action... the function will _create_ the action (hence the name: actionCreator). This provides us with a better testing story (easy to test), reusability, documentation, and encapsulation of logic.
63+
However, this is pretty poor practice. Rather than dispatch the action directly, we'll use a function to return an action... the function will _create_ the action (hence the name: actionCreator). This provides us with a better testing story (easy to test), reusability, documentation, and encapsulation of logic.
6464

6565
Let's create our first `actionCreator` in a file called `redux/actionCreators.js`. We'll export a function who's entire responsibility is to return an appropriate action to dispatch on our store.
6666

@@ -166,7 +166,7 @@ export const reducer = (state = initialState, action) => {
166166
Let's update our `configureStore()` function to take these branches into account, using the `combineReducers` to separate out the two branches
167167

168168
```javascript
169-
169+
170170
import { createStore, combineReducers } from 'redux';
171171

172172
import { rootReducer, initialState } from './reducers'
@@ -179,7 +179,7 @@ export const configureStore = () => {
179179
user: reducer
180180
}), // root reducer
181181
{
182-
time: initialState,
182+
time: initialState,
183183
user: userInitialState
184184
}, // our initialState
185185
);
@@ -203,7 +203,7 @@ export const logout = () => ({
203203
})
204204
```
205205

206-
Now we can use the actionCreators to call `login` and `logout` just like the `updateTime()` action creator.
206+
Now we can use the actionCreators to call `login` and `logout` just like the `updateTime()` action creator.
207207

208208
Phew! This was another hefty day of Redux code. Today, we completed the circle between data updating and storing data in the global Redux state. In addition, we learned how to extend Redux to use multiple reducers and actions as well as multiple connected components.
209209

day-8/post.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ series: 30-days-of-react
44
permalink: day-8
55
title: Packaging and PropTypes
66
description: >-
7-
We're looking at how to make reusable React components today so that not only
8-
can we share our components across apps and teams.
7+
We're looking at how to make reusable React components today so we can share our components across apps and teams.
98
dayDir: 08
109
day: 8
1110
hero_image: /assets/images/series/30-days-of-react/headings/8.jpg

0 commit comments

Comments
 (0)