Skip to content

Commit c465f66

Browse files
authored
Merge pull request #7 from foriacus/master
fix typo error.
2 parents bf50677 + b916326 commit c465f66

File tree

2 files changed

+22
-23
lines changed

2 files changed

+22
-23
lines changed

v1/en-us/concepts.md

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
`type State = any`
1414

15-
The state tree of your models. Usually, the state is a javascript object(Technically it can be any type), witch is a immutable data.
15+
The state tree of your models. Usually, the state is a javascript object(Technically it can be any type), which is a immutable data.
1616

1717
In dva, you can access top state tree data by `_store`.
1818

@@ -25,7 +25,7 @@ console.log(app._store); // top state
2525

2626
`type AsyncAction = any`
2727

28-
Just like Redux's Action, in dva, action is a plain object that represents an intention to change the state. Actions are the only way to get data into the store. Any data, whether from UI events, network callbacks, or other sources such as WebSockets needs to eventually be dispatched as actions.action.(ps:dispatch is realized trhough props by connecting components.)
28+
Just like Redux's Action, in dva, action is a plain object that represents an intention to change the state. Actions are the only way to get data into the store. Any data, whether from UI events, network callbacks, or other sources such as WebSockets needs to eventually be dispatched as actions.action.(ps:dispatch is realized through props by connecting components.)
2929

3030
```javascript
3131
dispatch({
@@ -39,7 +39,7 @@ dispatch({
3939

4040
A dispatching function (or simply dispatch function) is a function that accepts an action or an async action; it then may or may not dispatch one or more actions to the store.
4141

42-
Dispatching function is a function for triggering action, action is the only way to change state, but it just describes an action. while dispatch can be regarded as a way to trigger this action, and Reducer is to describe how to change state.
42+
Dispatching function is a function for triggering action, action is the only way to change state, but it just describes an action. while dispatch can be regarded as a way to trigger this action, and Reducer is to describe how to change state.
4343

4444
```javascript
4545
dispatch({
@@ -54,23 +54,23 @@ dispatch({
5454

5555
Just like Redux's Reducer, a reducer (also called a reducing function) is a function that accepts an accumulation and a value and returns a new accumulation. They are used to reduce a collection of values down to a single value.
5656

57-
Reducer's concepets from FP:
57+
Reducer's concepts from FP:
5858

5959
```javascript
60-
[{x:1},{y:2},{z:3}].reduce(function(prev, next){
61-
return Object.assign(prev, next);
60+
[{x:1},{y:2},{z:3}].reduce(function(prev, next){
61+
return Object.assign(prev, next);
6262
})
6363
//return {x:1, y:2, z:3}
6464
```
6565

66-
In dva, reducers accumule current model's state. There are some things need to be notice that reducer must be [pure function](https://github.com/MostlyAdequate/mostly-adequate-guide/blob/master/ch3.md) and every caclulated data must be [immutable data](https://github.com/MostlyAdequate/mostly-adequate-guide/blob/master/ch3.md#reasonable).
66+
In dva, reducers accumulate current model's state. There are some things need to be notice that reducer must be [pure function](https://github.com/MostlyAdequate/mostly-adequate-guide/blob/master/ch3.md) and every calculated data must be [immutable data](https://github.com/MostlyAdequate/mostly-adequate-guide/blob/master/ch3.md#reasonable).
6767

6868
### Effect
6969

70-
In dva, we use [redux-sagas](http://yelouafi.github.io/redux-saga/) to control asynchronous flow.
70+
In dva, we use [redux-sagas](http://yelouafi.github.io/redux-saga/) to control asynchronous flow.
7171
You can learn more in [Mostly adequate guide to FP](https://github.com/MostlyAdequate/mostly-adequate-guide).
7272

73-
In our applications, the most well-known side effect is asynchronous operation, it comes from the conception of fuctional programing, it is called side effect because it makes our function impure, and the same input may not result in the same output.
73+
In our applications, the most well-known side effect is asynchronous operation, it comes from the conception of functional programing, it is called side effect because it makes our function impure, and the same input may not result in the same output.
7474

7575
### Subscription
7676

@@ -93,7 +93,7 @@ app.model({
9393

9494
## Router
9595

96-
Hereby router usually means frontend router. Because our current app is singel page app, frontend codes are required to control the router logics. Through History API provided by the browser, we can monitor the change of the browser's url, so as to control the router.
96+
Hereby router usually means frontend router. Because our current app is single page app, frontend codes are required to control the router logics. Through History API provided by the browser, we can monitor the change of the browser's url, so as to control the router.
9797

9898
dva provide `router` function to control router, based on [react-router](https://github.com/reactjs/react-router)
9999

@@ -108,13 +108,12 @@ app.router(({history}) =>
108108

109109
## Route Components
110110

111-
In dva, we restrict container components to route componenst, because we use page dimension to design container components.
111+
In dva, we restrict container components to route components, because we use page dimension to design container components.
112112

113-
therefore, almost all connet model componets are route components, route components in `/routes/` directory, presentational Components in `/components/` directory.
113+
therefore, almost all connected model components are route components, route components in `/routes/` directory, presentational Components in `/components/` directory.
114114

115115
## References
116116
- [redux docs](http://redux.js.org/docs/Glossary.html)
117117
- [Mostly adequate guide to FP](https://github.com/MostlyAdequate/mostly-adequate-guide)
118118
- [choo docs](https://github.com/yoshuawuyts/choo)
119119
- [elm](http://elm-lang.org/blog/farewell-to-frp)
120-

v1/en-us/getting-started.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Some questions you may ask.
1818
2. How to organize code after created app?
1919
3. How to build, deploy and publish after development?
2020

21-
And somethins about code organization.
21+
And somethings about code organization.
2222

2323
1. How to write Component?
2424
1. How to write CSS?
@@ -77,7 +77,7 @@ Open http://localhost:8989/ in browser. If success, you will see a page with "He
7777

7878
## Define models
7979

80-
When get the task, you should not write code immediatly. But recommend to do state design in `god mode`.
80+
When get the task, you should not write code immediately. But recommend to do state design in `god mode`.
8181

8282
1. design models
8383
2. design components
@@ -99,7 +99,7 @@ app.model({
9999

100100
## Write components
101101

102-
After designed model, we start to write component. Recommend to organize Component with [stateless functions](https://facebook.github.io/react/docs/reusable-components.html#stateless-functions). Because we don't need state almostly in dva architecture.
102+
After designed model, we start to write component. Recommend to organize Component with [stateless functions](https://facebook.github.io/react/docs/reusable-components.html#stateless-functions). Because we don't need state almost in dva architecture.
103103

104104
```javascript
105105
import styles from './index.less';
@@ -132,7 +132,7 @@ Notice:
132132

133133
We need two reducers, `add` and `minus`. Please notice `add` will only be recorded if it's highest.
134134

135-
> Notice: `add` and `minus` don't need to add namespace prefix in `count` model. But if outside the model, action must prefix namespace seperated with `/`. e.g. `count/add`.
135+
> Notice: `add` and `minus` don't need to add namespace prefix in `count` model. But if outside the model, action must prefix namespace separated with `/`. e.g. `count/add`.
136136
137137
```diff
138138
app.model({
@@ -165,7 +165,7 @@ Notice:
165165

166166
> Remember `count` and `dispatch` props used in the Component before? Where are them come from?
167167
168-
After defined Model and Component, we need to connect them together. After connect, Component can use the data from Model, and Model can receive actions dispatched from Component.
168+
After define Model and Component, we need to connect them together. After connect, Component can use the data from Model, and Model can receive actions dispatched from Component.
169169

170170
In this task, we only need to bind `count` .
171171

@@ -204,7 +204,7 @@ Refresh page in browser, if success, you will see page below.
204204

205205
## Add StyleSheet
206206

207-
We define stylesheet in `css modules`, which doesn't have many difference from normal css. Because we have already hooked className in Component, at this moment, we only need to replace `index.less` with follow content:
207+
We define stylesheet in `css modules`, which doesn't have many differences from normal css. Because we have already hooked className in Component, at this moment, we only need to replace `index.less` with follow content:
208208

209209
```css
210210
.normal {
@@ -276,9 +276,9 @@ Notice:
276276

277277
Refresh you browser, if success, it should have all the effects of beginning gif.
278278

279-
## Subscribe Keboard Event
279+
## Subscribe Keyboard Event
280280

281-
> After implemented mouse click speed test, how to implement keyboard click speed test?
281+
> After implemented mouse click speed test, how to implement keyboard click speed test?
282282
283283
There is a concept called `Subscription` from dva, which is from [elm 0.17](http://elm-lang.org/blog/farewell-to-frp).
284284

@@ -416,6 +416,6 @@ After build success, you can find compiled files in `dist` directory.
416416

417417
## What's Next
418418

419-
After complete this app, do you have answer of all the questions in the begenning? Do you understand ths concepts in dva, like `model`, `router`, `reducers`, `effects` and `subscriptions` ?
419+
After complete this app, do you have answer of all the questions in the beginning? Do you understand this concepts in dva, like `model`, `router`, `reducers`, `effects` and `subscriptions` ?
420420

421-
Next, you can view [dva offical library](https://github.com/dvajs/dva) for more infomation.
421+
Next, you can view [dva official library](https://github.com/dvajs/dva) for more information.

0 commit comments

Comments
 (0)