Skip to content
This repository was archived by the owner on Nov 18, 2024. It is now read-only.

Commit ba42420

Browse files
committed
update readme
1 parent fc3f3f2 commit ba42420

File tree

7 files changed

+106
-78
lines changed

7 files changed

+106
-78
lines changed

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ charset = utf-8
77
trim_trailing_whitespace = true
88
insert_final_newline = true
99
[*.md]
10-
trim_trailing_whitespace = false
10+
trim_trailing_whitespace = false

README.md

Lines changed: 87 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,61 @@
1-
[![Create React Redux App](readme/cover.png)](https://yingray.github.io/create-react-redux-app/)
1+
# [![Create React Redux App](readme/cover.png)](https://yingray.github.io/create-react-redux-app/)
22

33
[![Build Status](https://travis-ci.org/yingray/create-react-redux-app.svg?branch=master)](https://travis-ci.org/yingray/create-react-redux-app)
44
[![Coverage Status](https://coveralls.io/repos/github/yingray/create-react-redux-app/badge.svg?branch=master)](https://coveralls.io/github/yingray/create-react-redux-app?branch=master)
55

6-
# We will have the new structure for REDUX soon! (Sep. 2017)
6+
This project was bootstrapped with Create React App and Redux, Sass Structure.
77

8-
This project was bootstrapped with Create React App and Redux Structure.
8+
# Todo List
99

10-
Todo List (Redux):
10+
* react + redux sample practice
1111

1212
![demo](readme/demo.gif)
1313

14-
API (fetch):
14+
# fetch API
15+
16+
* Handle async event
17+
18+
* async/await + api-book sample practice
1519

1620
![demo-api](readme/demo-api.gif)
1721

22+
# Getting Started
1823

1924
## Dependencies
2025

2126
* React
22-
* react
23-
* react-dom
27+
* react
28+
* react-dom
2429

2530
* Create React App
26-
* react-scripts
31+
* react-scripts
2732

2833
* Redux
29-
* redux
30-
* react-redux
31-
* react-router
32-
* react-router-redux
33-
* redux-thunk
34-
34+
* redux
35+
* react-redux
36+
* react-router
37+
* react-router-redux
38+
* redux-thunk
39+
40+
* Sass
41+
* node-sass-chokidar
42+
3543
* Fetch
36-
* babel-polyfill
37-
* isomorphic-fetch
44+
* api-book
45+
* babel-polyfill
3846

3947
* Github Deployment Tool
4048
* gh-pages
4149

42-
## Getting Started
43-
44-
### Installation
50+
## Installation
4551

46-
To create a new react-redux app, run:
52+
To create a new react-redux-sass app, run:
4753

4854
```sh
4955
git clone https://github.com/yingray/create-react-redux-app.git ~/create-react-redux-app
5056
cd ~/create-react-redux-app
51-
npm install
57+
# yarn or npm install
58+
yarn
5259
```
5360

5461
It will create a directory called **create-react-redux-app** inside the current folder.
@@ -58,63 +65,84 @@ Inside that directory, it will generate the initial project structure and instal
5865
create-react-redux-app/
5966
src/
6067
actions/
61-
index.js
68+
todoActions.js
69+
weatherActions.js
6270
components/
63-
HomePage.js
64-
Card.js
65-
TodoFooter.js
66-
Link.js
67-
Todo.js
68-
TodoList.js
71+
App.js
72+
Header.js
73+
Link.js
74+
Navigation.js
75+
Todo.js
76+
TodoFooter.js
77+
TodoList.js
6978
constants/
70-
ActionTypes.js
79+
ActionTypes.js
7180
containers/
72-
AddTodo.js
73-
HomePage.js
74-
FilterLink.js
75-
VisibleTodoList.js
81+
AddTodo.js
82+
FilterLink.js
83+
VisibleTodoList.js
84+
Weather.js
7685
images/
77-
logo.svg
86+
logo.svg
87+
pages/
88+
Home.js
89+
Todo.js
90+
Weather.js
7891
reducers/
79-
index.js
80-
todos.js
81-
visibilityFilter.js
92+
todos.js
93+
visibilityFilter.js
94+
weatherReducer.js
95+
services/
96+
weatherApi.js
8297
styles/
83-
App.css
84-
index.css
98+
base/
99+
components/
100+
config/
101+
layout/
102+
pages/
103+
utils/
104+
vendors/
105+
main.scss
85106
index.js
86-
test/
87-
App.spec.js
88-
107+
registerServiceWorker.js
108+
routes.js
109+
store.js
110+
--
111+
tests/
112+
components/
113+
App.spec.js
114+
reducers/
115+
weatherReducer.spec.js
89116
--
90-
README.md
91-
node_modules/
92-
package.json
93-
.gitignore
94117
public/
95118
favicon.ico
96119
index.html
120+
--
121+
node_modules/
122+
.editorconfig
123+
package.json
124+
README.md
97125
```
98126

99-
### Runs the app in development mode:
127+
### Runs the app in development mode
100128

101-
```
129+
```bash
102130
npm start
103131
```
104132

105-
Open http://localhost:3000 to view it in the browser.
133+
Open `http://localhost:3000` to view it in the browser.
106134

107-
### Runs the test watcher in an interactive mode:
135+
### Runs the test watcher in an interactive mode
108136

109-
```
137+
```bash
110138
npm test
111139
```
112140

113141
By default, runs tests related to files changes since the last commit.
114142

115143
### Builds the app for production to the build folder:
116144

117-
```
145+
```bash
118146
npm run build
119147
```
120148

@@ -124,18 +152,20 @@ Your app is ready to be deployed!
124152

125153
Reference: https://github.com/facebookincubator/create-react-app
126154

127-
### Deploys the production to github.io page:
155+
### Deploys the production to github.io page
128156

129157
Changes package.json
130-
131-
```
158+
159+
```js
132160
"homepage": "http://{account_name}.github.io/{project_name}",
161+
"scripts": {
162+
"predeploy": "npm run build"
163+
}
133164
```
134165

135166
And runs
136167

137-
```
138-
npm run build
168+
```bash
139169
npm run deploy
140170
```
141171

package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "create-react-redux-app",
3-
"version": "0.2.0",
3+
"version": "1.0.0",
44
"homepage": "http://yingray.github.io/create-react-redux-app",
55
"scripts": {
66
"start": "npm run watch:css & react-scripts start",
@@ -20,9 +20,7 @@
2020
"api-book": "^0.2.4",
2121
"babel-polyfill": "^6.23.0",
2222
"expect": "^1.20.2",
23-
"fetch-jsonp": "^1.0.2",
2423
"gh-pages": "^1.0.0",
25-
"isomorphic-fetch": "^2.2.1",
2624
"node-sass-chokidar": "^0.0.3",
2725
"react-redux": "^5.0.6",
2826
"react-router": "^3.0.5",

readme/cover.png

28 KB
Loading

readme/demo-api.gif

41.9 KB
Loading

readme/demo.gif

-420 KB
Loading

src/actions/todoActions.js

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
import * as types from '../constants/ActionTypes'
22

33
let nextTodoId = 0
4-
export const addTodo = (text) => {
5-
return {
6-
type: types.ADD_TODO,
7-
id: nextTodoId++,
8-
text
9-
}
4+
export const addTodo = text => {
5+
return {
6+
type: types.ADD_TODO,
7+
id: nextTodoId++,
8+
text
9+
}
1010
}
1111

12-
export const setVisibilityFilter = (filter) => {
13-
return {
14-
type: types.SET_VISIBILITY_FILTER,
15-
filter
16-
}
12+
export const setVisibilityFilter = filter => {
13+
return {
14+
type: types.SET_VISIBILITY_FILTER,
15+
filter
16+
}
1717
}
1818

19-
export const toggleTodo = (id) => {
20-
return {
21-
type: types.TOGGLE_TODO,
22-
id
23-
}
24-
}
19+
export const toggleTodo = id => {
20+
return {
21+
type: types.TOGGLE_TODO,
22+
id
23+
}
24+
}

0 commit comments

Comments
 (0)