Skip to content

Commit 8440b50

Browse files
committed
fix minor typos
1 parent 7a709e1 commit 8440b50

11 files changed

+23
-23
lines changed

01_simple-action-creator.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ console.log(actionCreator())
3636
// To dispatch an action we need... a dispatch function ("Captain obvious").
3737
// And to let anyone interested know that an action happened, we need a mechanism to register
3838
// "handlers". Such "handlers" to actions in traditional flux application are called stores and
39-
// we'll see in the next section how they are called in redux.
39+
// we'll see in the next section how they are called in Redux.
4040

4141
// So far here is the flow of our application:
4242
// ActionCreator -> Action

03_simple-reducer.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import { createStore } from 'redux'
1818
var store_0 = createStore(() => {})
1919

2020
// ... so that Redux can call this function on your application state each time an action occurs.
21-
// Giving reducer(s) to createStore is exactly how redux registers the action "handlers" (read reducers) we
21+
// Giving reducer(s) to createStore is exactly how Redux registers the action "handlers" (read reducers) we
2222
// were talking about in section 01_simple-action-creator.js.
2323

2424
// Let's put some log in our reducer

04_get-state.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ var store_3 = createStore(reducer_3)
8181
// Output: reducer_3 was called with state {} and action { type: '@@redux/INIT' }
8282

8383
console.log('store_3 state after initialization:', store_3.getState())
84-
// Output: redux state after initialization: {}
84+
// Output: store_3 state after initialization: {}
8585

8686
// Nothing new in our state so far since we did not dispatch any action yet. But there are few
8787
// important things to pay attention to in the last example:

07_dispatch-async-action-1.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
// Of course this message is part of our application state so we have to save it
1515
// in Redux store. But what we want is to have our store save the message
1616
// only 2 seconds after the action creator is called (because if we were to update our state
17-
// immediately, any subscriber to state's modifications - like our view - would be notified right away
17+
// immediately, any subscriber to state's modifications - like our view - would be notified right away
1818
// and would then react to this update 2 seconds too soon).
1919

2020
// If we were to call an action creator like we did until now...

09_middleware.js

+8-8
Original file line numberDiff line numberDiff line change
@@ -34,19 +34,19 @@
3434
*/
3535

3636
// As you can see above, a middleware is made of 3 nested functions (that will get called sequentially):
37-
// 1) The first level provide the dispatch function and a getState function (if your
37+
// 1) The first level provides the dispatch function and a getState function (if your
3838
// middleware or your action creator needs to read data from state) to the 2 other levels
39-
// 2) The second level provide the next function that will allow you to explicitly hand over
39+
// 2) The second level provides the next function that will allow you to explicitly hand over
4040
// your transformed input to the next middleware or to Redux (so that Redux can finally call all reducers).
4141
// 3) the third level provides the action received from the previous middleware or from your dispatch
4242
// and can either trigger the next middleware (to let the action continue to flow) or process
4343
// the action in any appropriate way.
4444

4545
// Those of you who are trained to functional programming may have recognized above an opportunity
4646
// to apply a functional pattern: currying (if you aren't, don't worry, skipping the next 10 lines
47-
// won't affect your redux understanding). Using currying, you could simplify the above function like that:
47+
// won't affect your Redux understanding). Using currying, you could simplify the above function like that:
4848
/*
49-
// "curry" may come any functional programming library (lodash, ramda, etc.)
49+
// "curry" may come from any functional programming library (lodash, ramda, etc.)
5050
var thunkMiddleware = curry(
5151
({dispatch, getState}, next, action) => (
5252
// your middleware-specific code goes here
@@ -79,7 +79,7 @@ var thunkMiddleware = function ({ dispatch, getState }) {
7979
// store that applies middleware to a store's dispatch".
8080
// (from https://github.com/rackt/redux/blob/v1.0.0-rc/src/utils/applyMiddleware.js)
8181

82-
// Here is how you would integrate a middleware to your Redux store:
82+
// Here is how you would integrate a middleware into your Redux store:
8383

8484
import { createStore, combineReducers, applyMiddleware } from 'redux'
8585

@@ -144,7 +144,7 @@ function logMiddleware ({ dispatch, getState }) {
144144
}
145145
}
146146

147-
// Same below for a middleware to discard all actions that goes through (not very useful as is
147+
// Same below for a middleware to discard all actions that are dispatched (not very useful as is
148148
// but with a bit of more logic it could selectively discard a few actions while passing others
149149
// to next middleware or Redux):
150150
function discardMiddleware ({ dispatch, getState }) {
@@ -161,7 +161,7 @@ function discardMiddleware ({ dispatch, getState }) {
161161
// const finalCreateStore = applyMiddleware(discardMiddleware, thunkMiddleware)(createStore)
162162
// should make your actions never reach your thunkMiddleware and even less your reducers.
163163

164-
// See http://rackt.org/redux/docs/introduction/Ecosystem.html, section Middlewares, to
164+
// See http://rackt.org/redux/docs/introduction/Ecosystem.html, section Middleware, to
165165
// see other middleware examples.
166166

167167
// Let's sum up what we've learned so far:
@@ -170,7 +170,7 @@ function discardMiddleware ({ dispatch, getState }) {
170170
// 3) We know how to handle custom actions like asynchronous actions thanks to middlewares
171171

172172
// The only missing piece to close the loop of Flux application is to be notified about
173-
// state updates to be able to react to them (by re-rendering our components for example).
173+
// state updates in order to react to them (by re-rendering our components for example).
174174

175175
// So how do we subscribe to our Redux store updates?
176176

10_state-subscriber.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
// Without it, we cannot update our views when the store changes.
1111

12-
// Fortunately, there is a very simple way to "watch" over our Redux's store updates:
12+
// Fortunately, there is a very simple way to "watch" over our Redux store's updates:
1313

1414
/*
1515
store.subscribe(function() {
@@ -88,7 +88,7 @@ store_0.dispatch(addItemActionCreator({ id: 1234, description: 'anything' }))
8888
// the same time also seems to not provide enough features?
8989

9090
// Its simplicity is actually its power! Redux, with its current minimalist API (including "subscribe") is
91-
// highly extensible and this allows developers to build some crazy products like the Redux DevTools
91+
// highly extensible and this allows developers to build some crazy products like the Redux DevTools
9292
// (https://github.com/gaearon/redux-devtools).
9393

9494
// But in the end we still need a "better" API to subscribe to our store changes. That's exactly what react-redux
@@ -97,7 +97,7 @@ store_0.dispatch(addItemActionCreator({ id: 1234, description: 'anything' }))
9797
// use bindings such as "provide" or "connect" and those will hide from you the "subscribe" method.
9898

9999
// So yeah, the "subscribe" method will still be used but it will be done through a higher order API that
100-
// handles access to redux state for you.
100+
// handles access to Redux state for you.
101101

102102
// We'll now cover those bindings and show how simple it is to wire your components to Redux's state.
103103

11_Provider-and-connect.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import server from './11_src/src/server'
3131
// if port equals X, we'll use X for server's port and X+1 for webpack-dev-server's port
3232
const port = 5050
3333

34-
// Start our webpack dev server...
34+
// Start our Webpack dev server...
3535
webpackDevServer.listen(port)
3636
// ... and our main app server.
3737
server.listen(port)

11_src/src/create-store.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import promiseMiddleware from './promise-middleware'
1919
// ./reducers.js to see what our reducer actually do (no magic there).
2020
import * as reducers from './reducers'
2121

22-
// The data parameter that we see here is used to initialize our redux store with data. We didn't
22+
// The data parameter that we see here is used to initialize our Redux store with data. We didn't
2323
// talk about this yet for simplicity but thanks to it your reducers can be initialized
2424
// with real data if you already have some. For example in an isomorphic/universal app where you
2525
// fetch data server-side, serialize and pass it to the client, your Redux store can be

11_src/src/index.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import createStore from './create-store'
1010
// Application is the root component of our application and the one that holds Redux's Provider...
1111
import Application from './application'
1212

13-
// Just as we did so many times in previous examples, we need to create our redux instance. This time
13+
// Just as we did so many times in previous examples, we need to create our Redux instance. This time
1414
// all code for that task was moved to a specific module that returns a single function to trigger the
1515
// instantiation.
1616
const store = createStore()

11_src/src/server.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99
// 2) the connect function
1010

1111
// But before we get to that, let's see the basic setup of this application and how it
12-
// will be served to browser...
12+
// will be served to a browser...
1313

1414
// We won't use Express (http://expressjs.com/) in this app since we don't really need
1515
// it to serve a simple html page.
1616

17-
// "http" module will be used to create the http server
17+
// "http" module will be used to create the HTTP server
1818
import http from 'http'
1919
import React from 'react'
2020

@@ -30,7 +30,7 @@ var server = http.createServer(function(req, res) {
3030

3131
// And of course, here is our Application HTML that we're sending back to the browser.
3232
// Nothing special here except the URI of our application JS bundle that points to our
33-
// webpack dev server (located at http://localhost:5051)
33+
// Webpack dev server (located at http://localhost:5051)
3434
res.write(
3535
`<!DOCTYPE html>
3636
<html>
@@ -49,6 +49,6 @@ var server = http.createServer(function(req, res) {
4949

5050
export default server
5151

52-
// Go to ./index.jsx, where our app is initialized. For those of you who are not familiar with webpack,
52+
// Go to ./index.jsx, where our app is initialized. For those of you who are not familiar with Webpack,
5353
// index.jsx is defined as the entry point (the first file) of our JS bundle (in 12_src/webpack.config.js)
5454
// and is automatically executed when the JS bundle is loaded in our browser.

12_final-words.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// already bound to dispatch - http://rackt.org/redux/docs/api/bindActionCreators.html).
66

77
// We hope we've given you the keys to better understand Flux and to see more clearly
8-
// how Flux implementations differ from one another--especially how Redux stands out ;).
8+
// how Flux implementations differ from one another - especially how Redux stands out ;).
99

1010
// Where to go from here?
1111

0 commit comments

Comments
 (0)