Skip to content

Commit 833dbf2

Browse files
committed
翻译03 合并错项目了 不过还好(-。-;)
1 parent 2ea9d3c commit 833dbf2

File tree

3 files changed

+6
-74
lines changed

3 files changed

+6
-74
lines changed

03_about-state-and-meet-redux.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@
6060
// 1) a place to put your application state
6161
// 2) a mechanism to subscribe to state updates
6262
// 3) a mechanism to dispatch actions to modifiers of your application state, AKA reducers
63+
// 总结一下,Redux能给你带来的有:
64+
// 1)一个你存放应用全局状态的容器
65+
// 2)一个监听者状态变更的机制
66+
// 3)一个调度action来改变应用状态的机制,又名reducers
6367

6468
// The Redux instance is called a store and can be created like this:
6569
/*
@@ -68,9 +72,11 @@
6872
*/
6973

7074
// But if you run the code above, you'll notice that it throw an error:
75+
// 但是如果你执行上面的代码,你会发现抛出了错误异常
7176
// Error: Invariant Violation: Expected the reducer to be a function.
7277

7378
// That's because createStore expects a function that will allow it to reduce your state.
79+
// 这是因为createStore期望一个function来允许reduce应用state
7480

7581
// Let's try again
7682

README.md

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
<<<<<<< HEAD
21
redux-tutorial
32
=========================
43

@@ -34,44 +33,4 @@ Being real js files, each example can be run to verify that it works as intended
3433

3534
Enjoy!
3635
=======
37-
[![Deploy](https://www.herokucdn.com/deploy/button.png)](https://heroku.com/deploy)
3836

39-
# React Tutorial
40-
41-
This is the React comment box example from [the React tutorial](http://facebook.github.io/react/docs/tutorial.html).
42-
43-
## To use
44-
45-
There are several simple server implementations included. They all serve static files from `public/` and handle requests to `comments.json` to fetch or add data. Start a server with one of the following:
46-
47-
### Node
48-
49-
```sh
50-
npm install
51-
node server.js
52-
```
53-
54-
### Python
55-
56-
```sh
57-
pip install -r requirements.txt
58-
python server.py
59-
```
60-
61-
### Ruby
62-
```sh
63-
ruby server.rb
64-
```
65-
66-
### PHP
67-
```sh
68-
php server.php
69-
```
70-
71-
### Go
72-
```sh
73-
go run server.go
74-
```
75-
76-
And visit <http://localhost:3000/>. Try opening multiple tabs!
77-
>>>>>>> bb30eecab69b8bdebb00bfa56e82222f36270178

package.json

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{
2-
<<<<<<< HEAD
32
"name": "redux-tutorial",
43
"version": "0.0.1",
54
"description": "Learn how to use redux step by step",
@@ -34,37 +33,5 @@
3433
"babel-eslint": "^3.1.9",
3534
"eslint-plugin-react": "^2.3.0",
3635
"webpack-dev-server": "^1.8.2"
37-
=======
38-
"name": "react-tutorial",
39-
"version": "0.0.0",
40-
"description": "Code from the React tutorial.",
41-
"main": "server.js",
42-
"dependencies": {
43-
"body-parser": "^1.4.3",
44-
"express": "^4.4.5"
45-
},
46-
"devDependencies": {},
47-
"scripts": {
48-
"test": "echo \"Error: no test specified\" && exit 1",
49-
"start": "node server.js"
50-
},
51-
"repository": {
52-
"type": "git",
53-
"url": "https://github.com/reactjs/react-tutorial.git"
54-
},
55-
"keywords": [
56-
"react",
57-
"tutorial",
58-
"comment",
59-
"example"
60-
],
61-
"author": "petehunt",
62-
"bugs": {
63-
"url": "https://github.com/reactjs/react-tutorial/issues"
64-
},
65-
"homepage": "https://github.com/reactjs/react-tutorial",
66-
"engines" : {
67-
"node" : "0.12.x"
68-
>>>>>>> bb30eecab69b8bdebb00bfa56e82222f36270178
6936
}
7037
}

0 commit comments

Comments
 (0)