Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit4a2e64a

Browse files
committed
steps 1-2 final check
1 parenta3289a6 commit4a2e64a

File tree

9 files changed

+25
-28
lines changed

9 files changed

+25
-28
lines changed

‎README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Running `> npm run setup` will do the following:
3434

3535
You'll find this "setup" script located in your*package.json*.
3636

37-
>We'll be installing several NPM packages from terminal. You may consider installing a plugin for adding a terminal inside your editor, such as["platformio-ide-terminal"](https://github.com/platformio/platformio-atom-ide-terminal).
37+
We'll be installing several NPM packages from terminal. You may consider installing a plugin for adding a terminal inside your editor, such as["platformio-ide-terminal"](https://github.com/platformio/platformio-atom-ide-terminal).
3838

3939
#####The Store
4040

@@ -47,7 +47,7 @@ Once created, the **store** has several helpful methods:
4747

4848
>[Learn more](http://redux.js.org/docs/basics/Store.html).
4949
50-
Let's get started by settings up the**store** for your Redux app.
50+
Let's get started by settings up the**store** for your Redux app. We will be working in "src/index.js".
5151

5252
#####Actions
5353

‎coderoad.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"pages": [
77
{
88
"title":"Project Setup",
9-
"description":"Welcome! In this tutorial series we'll be exploring Redux, a tool for predictably managing state in your app.\n\nWe will be making a\"Worst Pokemon\" voting app. For the app, we'll need to setup some build tools.\n\nRunning `> npm run setup` will do the following:\n\n1. Install package dev dependencies\n2. Create an output directory called\"dist\"\n3. Install\"concurrently\" &\"browser-sync\" globally\n4. Run our app in the browser\n\nYou'll find this\"setup\" script located in your *package.json*.\n\n> We'll be installing several NPM packages from terminal. You may consider installing a plugin for adding a terminal inside your editor, such as [\"platformio-ide-terminal\"](https://github.com/platformio/platformio-atom-ide-terminal).",
9+
"description":"Welcome! In this tutorial series we'll be exploring Redux, a tool for predictably managing state in your app.\n\nWe will be making a\"Worst Pokemon\" voting app. For the app, we'll need to setup some build tools.\n\nRunning `> npm run setup` will do the following:\n\n1. Install package dev dependencies\n2. Create an output directory called\"dist\"\n3. Install\"concurrently\" &\"browser-sync\" globally\n4. Run our app in the browser\n\nYou'll find this\"setup\" script located in your *package.json*.\n\nWe'll be installing several NPM packages from terminal. You may consider installing a plugin for adding a terminal inside your editor, such as [\"platformio-ide-terminal\"](https://github.com/platformio/platformio-atom-ide-terminal).",
1010
"tasks": [
1111
{
1212
"description":"Open a terminal in this project directory and run `npm run setup`. Save to continue.",
@@ -36,7 +36,7 @@
3636
},
3737
{
3838
"title":"The Store",
39-
"description":"In Redux, the **store** is the boss. Think of the **store** as holding the\"single source of truth\" of your application data.\n\nOnce created, the **store** has several helpful methods:\n - `getState` to read the current data of your app.\n - `dispatch` to trigger actions. We'll look at actions more later.\n - `subscribe` to listen for state changes\n\n> [Learn more](http://redux.js.org/docs/basics/Store.html).\n\nLet's get started by settings up the **store** for your Redux app.",
39+
"description":"In Redux, the **store** is the boss. Think of the **store** as holding the\"single source of truth\" of your application data.\n\nOnce created, the **store** has several helpful methods:\n - `getState` to read the current data of your app.\n - `dispatch` to trigger actions. We'll look at actions more later.\n - `subscribe` to listen for state changes\n\n> [Learn more](http://redux.js.org/docs/basics/Store.html).\n\nLet's get started by settings up the **store** for your Redux app. We will be working in\"src/index.js\".",
4040
"tasks": [
4141
{
4242
"description":"install Redux as a dependency.",
@@ -60,7 +60,7 @@
6060
]
6161
},
6262
{
63-
"description":"createyour first store andcall it `store`. Use a simple\"reducer\" function for now, let's say `state => state`.",
63+
"description":"use `createStore` to makeyour first store. Be sure tocall it `store`. Use a simple\"reducer\" function for now, let's say `state => state`. See [docs](http://redux.js.org/docs/api/createStore.html).",
6464
"hints": [
6565
"declare your store, `const store`",
6666
"call store with a simple reducer, `const store = createStore(state => state)`"
@@ -88,7 +88,7 @@
8888
]
8989
},
9090
{
91-
"description":"import the newly written data in 'data.js'. Set it to a variable called\"initialState\".",
91+
"description":"import the newly written data in 'data.js'. Set it to a variable called\"initialState\". Note: due to a bug with `import`'s, use `require` for imports.",
9292
"tests": [
9393
"02/06"
9494
],
@@ -102,7 +102,7 @@
102102
{
103103
"description":"pass in `initialState` as a second param your `createStore`",
104104
"tests": [
105-
"02/06"
105+
"02/07"
106106
],
107107
"hints": [
108108
"Pass in `initialState` as a second param to `createStore`"

‎package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@
2020
"testSuffix":".js"
2121
},
2222
"dependencies": {
23-
"mocha-coderoad":"^0.10.0"
23+
"mocha-coderoad":"^0.10.1"
2424
}
2525
}

‎tutorial/01/01.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,8 @@ const expect = require('chai').expect;
22

33
describe('01 setup',()=>{
44

5-
it('dist directory doesn\'t exist. Run `npm run setup`',()=>{
6-
expect(exists('dist')).to.be.true;
7-
});
8-
95
it('src directory doesn\'t exist. Run `npm run setup`',()=>{
6+
console.log(exists('src'));
107
expect(exists('src')).to.be.true;
118
});
129

‎tutorial/01/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Running `> npm run setup` will do the following:
1212

1313
You'll find this "setup" script located in your*package.json*.
1414

15-
>We'll be installing several NPM packages from terminal. You may consider installing a plugin for adding a terminal inside your editor, such as["platformio-ide-terminal"](https://github.com/platformio/platformio-atom-ide-terminal).
15+
We'll be installing several NPM packages from terminal. You may consider installing a plugin for adding a terminal inside your editor, such as["platformio-ide-terminal"](https://github.com/platformio/platformio-atom-ide-terminal).
1616

1717
+ Open a terminal in this project directory and run`npm run setup`. Save to continue.
1818
@test('01/01')

‎tutorial/01/package.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,18 @@
2121
"watch":"npm-watch"
2222
},
2323
"dependencies": {
24-
"mocha-coderoad":"0.9.3"
24+
"chai":"3.5.0",
25+
"chai-spies":"0.7.1",
26+
"mocha-coderoad":"^0.10.1"
2527
},
2628
"devDependencies": {
27-
"babel-preset-es2015":"^6.9.0",
29+
"babel-preset-es2015":"^6.13.2",
2830
"babel-preset-react":"^6.11.1",
2931
"babelify":"^7.3.0",
30-
"browser-sync":"^2.13.0",
32+
"browser-sync":"^2.14.0",
3133
"coderoad-redux-js":"^0.1.0",
3234
"concurrently":"^2.2.0",
33-
"npm-watch":"^0.1.5"
35+
"npm-watch":"^0.1.6"
3436
},
3537
"watch": {
3638
"reload": {

‎tutorial/02/06.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
constinitialState=indexJs.__get__('initialState');
2-
31
describe('06 initialState',()=>{
42

3+
constinitialState=indexJs.__get__('initialState');
4+
55
it('should be imported from "./src/data.js"',()=>{
66
expect(initialState).to.not.be.undefined;
77
expect(typeofinitialState).to.equal('object');

‎tutorial/02/07.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
describe('07 initialState',()=>{
22

33
it('should be called by `createStore`',()=>{
4-
expect(store.getState()).to.deep.equal(initialState);
5-
});
6-
7-
it('isn\'t logged to the console.',()=>{
8-
expect(spy).to.have.been.called.with(initialState);
4+
constinput=indexJs.__text__;
5+
constregex=/createStore\(.*,\s?initialState\s?\)/;
6+
expect(input).to.match(regex);
97
});
108

119
});

‎tutorial/02/index.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Once created, the **store** has several helpful methods:
88

99
>[Learn more](http://redux.js.org/docs/basics/Store.html).
1010
11-
Let's get started by settings up the**store** for your Redux app.
11+
Let's get started by settings up the**store** for your Redux app. We will be working in "src/index.js".
1212

1313

1414
+ install Redux as a dependency.
@@ -20,7 +20,7 @@ Let's get started by settings up the **store** for your Redux app.
2020
@hint('Add`import { createStore } from 'redux';`')
2121
@test('02/02')
2222

23-
+createyour first store andcall it`store`. Use a simple "reducer" function for now, let's say`state => state`.
23+
+use`createStore` to makeyour first store. Be sure tocall it`store`. Use a simple "reducer" function for now, let's say`state => state`. See[docs](http://redux.js.org/docs/api/createStore.html).
2424
@hint('declare your store,`const store`')
2525
@hint('call store with a simple reducer,`const store = createStore(state => state)`')
2626
@test('02/03')
@@ -33,13 +33,13 @@ Let's get started by settings up the **store** for your Redux app.
3333
@test('02/05')
3434
@hint('`console.log(store.getState())`')
3535

36-
+ import the newly written data in 'data.js'. Set it to a variable called "initialState".
36+
+ import the newly written data in 'data.js'. Set it to a variable called "initialState". Note: due to a bug with`import`'s, use`require` for imports.
3737
@test('02/06')
3838
@action(writeFromFile('src/data.js', '02/data.js'))
3939
@hint('Try this:`const initialState = require('./data.js').default;`')
4040

4141
+ pass in`initialState` as a second param your`createStore`
42-
@test('02/06')
42+
@test('02/07')
4343
@hint('Pass in`initialState` as a second param to`createStore`')
4444

4545
@onPageComplete('As you can see, the store is just an object with various methods like "dispatch" and "getState". Let's see what these methods do in the next step.')

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp