├── .gitignore
├── LICENSE
├── README.md
├── assets
└── logo-header.png
├── package.json
├── public
├── favicon.ico
├── index.html
└── manifest.json
├── publish.sh
└── src
├── App.js
├── components
├── TodoFooter.js
├── TodoHeader.js
├── TodoItem.js
├── TodoList.js
└── Todos.js
├── index.js
├── models
└── todoModel.js
└── services
└── todoService.js
/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/ignore-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | /node_modules
5 |
6 | # testing
7 | /coverage
8 |
9 | # production
10 | /build
11 |
12 | # misc
13 | .DS_Store
14 | .env.local
15 | .env.development.local
16 | .env.test.local
17 | .env.production.local
18 |
19 | npm-debug.log*
20 | yarn-debug.log*
21 | yarn-error.log*
22 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2017 RxJS 中文社区
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | # React RxJS Todos
6 |
7 | This repo shows a basic todos example base on the famous [TodoMVC](https://github.com/tastejs/todomvc) but using RxJS and React. The goal is to show how to use the Observables data architecture pattern within React. The implementation was inspired by the [React Rx TodoMVC Example](https://github.com/fdecampredon/react-rxjs-todomvc).
8 |
9 | > Try the [live demo](https://rxjs-cn.github.io/react-rxjs-todos/) here.
10 |
11 | ## Install
12 |
13 | > This React app was build with [create-react-app](https://github.com/facebookincubator/create-react-app).
14 |
15 | ```shell
16 | # clone the repo
17 | git clone git@github.com:RxJS-CN/react-rxjs-todos.git
18 |
19 | # change into the repo directory
20 | cd react-rxjs-todos
21 |
22 | # install dependencies
23 | npm install
24 |
25 | # run
26 | npm start
27 | ```
28 |
29 | Then visit [http://localhost:3000](http://localhost:3000) in your browser.
30 |
31 | ## Angular Version
32 |
33 | If you prefer Angular, you can checkout out [Angular RxJS Todos](https://github.com/RxJS-CN/angular-rxjs-todos)
34 |
35 | ## License
36 |
37 | MIT
38 |
--------------------------------------------------------------------------------
/assets/logo-header.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RxJS-CN/react-rxjs-todos/b412b049b3e21081b45e3ccae6cc35009ddd28a7/assets/logo-header.png
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "react-rxjs-todos",
3 | "version": "0.1.0",
4 | "private": true,
5 | "dependencies": {
6 | "classnames": "^2.2.5",
7 | "node-uuid": "^1.4.8",
8 | "react": "^15.6.1",
9 | "react-dom": "^15.6.1",
10 | "react-router-dom": "^4.1.2",
11 | "rxjs": "^5.4.2",
12 | "todomvc-app-css": "2.0.6",
13 | "todomvc-common": "1.0.2"
14 | },
15 | "devDependencies": {
16 | "react-scripts": "1.0.10"
17 | },
18 | "scripts": {
19 | "start": "react-scripts start",
20 | "build": "react-scripts build",
21 | "test": "react-scripts test --env=jsdom",
22 | "eject": "react-scripts eject",
23 | "publish": "./publish.sh"
24 | },
25 | "homepage": "https://rxjs-cn.github.io/react-rxjs-todos/"
26 | }
27 |
--------------------------------------------------------------------------------
/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RxJS-CN/react-rxjs-todos/b412b049b3e21081b45e3ccae6cc35009ddd28a7/public/favicon.ico
--------------------------------------------------------------------------------
/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
11 |
12 |
13 |
22 | React RxJS Todos
23 |
24 |
25 |
28 |
29 |
33 |
43 |
44 |
45 |
--------------------------------------------------------------------------------
/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "React App",
3 | "name": "Create React App Sample",
4 | "icons": [
5 | {
6 | "src": "favicon.ico",
7 | "sizes": "192x192",
8 | "type": "image/png"
9 | }
10 | ],
11 | "start_url": "./index.html",
12 | "display": "standalone",
13 | "theme_color": "#000000",
14 | "background_color": "#ffffff"
15 | }
16 |
--------------------------------------------------------------------------------
/publish.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 | #
3 | # Generates production code and pushes it up to the site
4 | #
5 |
6 | rm -rf ./build && \
7 | npm run build && \
8 | git checkout gh-pages && \
9 | git pull origin gh-pages && \
10 | cp -r ./build/ ./ && \
11 | rm -rf ./build && \
12 | git add . && \
13 | git commit -am "chore(publish): production code generated automatically" && \
14 | git push origin gh-pages
--------------------------------------------------------------------------------
/src/App.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import {
3 | BrowserRouter as Router,
4 | Route,
5 | Redirect
6 | } from 'react-router-dom';
7 |
8 | import Todos from './components/Todos';
9 |
10 | // todomvc styles
11 | import 'todomvc-common/base.css';
12 | import 'todomvc-app-css/index.css';
13 |
14 |
15 | const App = () => (
16 |