diff --git a/chapter-01/readme.md b/chapter-01/readme.md index 81c82956..3d22eb2a 100644 --- a/chapter-01/readme.md +++ b/chapter-01/readme.md @@ -91,7 +91,7 @@ To [http://output.jsbin.com/gosabo/quite](http://output.jsbin.com/gosabo/quiet) ##### Version 1 of the sample as output: [http://output.jsbin.com/gosabo/1](http://output.jsbin.com/gosabo/1) -##### Version 1 of te sample in the editor: +##### Version 1 of the sample in the editor: [http://output.jsbin.com/gosabo/1/edit](http://output.jsbin.com/gosabo/1/edit) ##### Version 2 of the sample as output: [http://output.jsbin.com/gosabo/2](http://output.jsbin.com/gosabo/2) diff --git a/chapter-02/01-declaring-variables/10-template-strings.html b/chapter-02/01-declaring-variables/10-template-strings.html index f3e668fd..d5d8e999 100644 --- a/chapter-02/01-declaring-variables/10-template-strings.html +++ b/chapter-02/01-declaring-variables/10-template-strings.html @@ -31,7 +31,7 @@

${article.title}

${article.body} ` diff --git a/chapter-02/05-promises/01-promises.html b/chapter-02/05-promises/01-promises.html index b7b686d8..e6d987e8 100644 --- a/chapter-02/05-promises/01-promises.html +++ b/chapter-02/05-promises/01-promises.html @@ -18,7 +18,7 @@

Promises

request.onload = () => (request.status === 200) ? resolves(JSON.parse(request.response).results) : - reject(Error(request.statusText)) + rejects(Error(request.statusText)) request.onerror = (err) => rejects(err) request.send() }) diff --git a/chapter-02/readme.md b/chapter-02/readme.md index 050ee90a..7d7c6cef 100644 --- a/chapter-02/readme.md +++ b/chapter-02/readme.md @@ -18,7 +18,7 @@ Samples 3. Without let ([demo](https://rawgit.com/MoonHighway/learning-react/master/chapter-02/01-declaring-variables/03-let.html), [code](http://github.com/MoonHighway/learning-react/blob/master/chapter-02/01-declaring-variables/03-let.html), [bin](http://jsbin.com/gapoxa/3/edit?js,output)) 4. With let ([demo](https://rawgit.com/MoonHighway/learning-react/master/chapter-02/01-declaring-variables/04-let.html), [code](http://github.com/MoonHighway/learning-react/blob/master/chapter-02/01-declaring-variables/04-let.html), [bin](http://jsbin.com/gapoxa/4/edit?js,output)) 5. Loops with var ([demo](https://rawgit.com/MoonHighway/learning-react/master/chapter-02/01-declaring-variables/05-let.html), [code](http://github.com/MoonHighway/learning-react/blob/master/chapter-02/01-declaring-variables/05-let.html), [bin](http://jsbin.com/gapoxa/5/edit?js,output)) - 6. Loops with const ([demo](https://rawgit.com/MoonHighway/learning-react/master/chapter-02/01-declaring-variables/06-let.html), [code](http://github.com/MoonHighway/learning-react/blob/master/chapter-02/01-declaring-variables/06-let.html), [bin](http://jsbin.com/gapoxa/6/edit?js,output)) + 6. Loops with let ([demo](https://rawgit.com/MoonHighway/learning-react/master/chapter-02/01-declaring-variables/06-let.html), [code](http://github.com/MoonHighway/learning-react/blob/master/chapter-02/01-declaring-variables/06-let.html), [bin](http://jsbin.com/gapoxa/6/edit?js,output)) #### template strings 7. Without Template Strings - Simple Concatenation ([demo](https://rawgit.com/MoonHighway/learning-react/master/chapter-02/01-declaring-variables/07-template-strings.html), [code](http://github.com/MoonHighway/learning-react/blob/master/chapter-02/01-declaring-variables/07-template-strings.html), [bin](http://jsbin.com/gapoxa/7/edit?js,output)) diff --git a/chapter-03/09-composition/04-imperative-clock.js b/chapter-03/09-composition/04-imperative-clock.js index 3ec1bc2d..3ea52914 100644 --- a/chapter-03/09-composition/04-imperative-clock.js +++ b/chapter-03/09-composition/04-imperative-clock.js @@ -15,7 +15,6 @@ function getClockTime() { // Get the Current Time var date = new Date(); - var time = ""; // Serialize clock time var time = { @@ -54,4 +53,4 @@ function getClockTime() { + time.seconds + " " + time.ampm; -} \ No newline at end of file +} diff --git a/chapter-07/01-mounting-lifecycle/02-mounting.html b/chapter-07/01-mounting-lifecycle/02-mounting.html index 4268d65c..fb366bd2 100644 --- a/chapter-07/01-mounting-lifecycle/02-mounting.html +++ b/chapter-07/01-mounting-lifecycle/02-mounting.html @@ -74,7 +74,7 @@

{name.first} {name.last}

) : 0 members loaded... } - {(error) ?

Error Loading Members: error

: ""} + {(error) ?

Error Loading Members: {error.message}

: ""} ) } diff --git a/chapter-07/06-managing-state-outside-react/02-flux.html b/chapter-07/06-managing-state-outside-react/02-flux.html new file mode 100644 index 00000000..b5971082 --- /dev/null +++ b/chapter-07/06-managing-state-outside-react/02-flux.html @@ -0,0 +1,159 @@ + + + + + + + + + + + + Flux + + +
+ + + diff --git a/chapter-07/mounting-lifecycle-clock/dist/assets/bundle.js b/chapter-07/mounting-lifecycle-clock/dist/assets/bundle.js index 31709cca..9ce57d82 100644 --- a/chapter-07/mounting-lifecycle-clock/dist/assets/bundle.js +++ b/chapter-07/mounting-lifecycle-clock/dist/assets/bundle.js @@ -21236,7 +21236,7 @@ var Clock = function (_Component) { hours = _state.hours, minutes = _state.minutes, seconds = _state.seconds, - timeOfDay = _state.timeOfDay; + ampm = _state.ampm; return React.createElement( 'div', @@ -21269,7 +21269,7 @@ var Clock = function (_Component) { React.createElement( 'span', null, - timeOfDay + ampm ), React.createElement( 'button', @@ -21323,7 +21323,7 @@ var civilianHours = exports.civilianHours = function civilianHours(clockTime) { var appendAMPM = exports.appendAMPM = function appendAMPM(clockTime) { return _extends({}, clockTime, { - ampm: clockTime.hours >= 12 ? "PM" : "AM" + ampm: clockTime.hours >= 12 ? "pm" : "am" }); }; @@ -21353,7 +21353,7 @@ var doubleDigits = exports.doubleDigits = function doubleDigits(civilianTime) { return compose(prependZero("hours"), prependZero("minutes"), prependZero("seconds"))(civilianTime); }; -var getClockTime = exports.getClockTime = compose(getCurrentTime, abstractClockTime, convertToCivilianTime, doubleDigits); +var getClockTime = exports.getClockTime = compose(getCurrentTime, abstractClockTime, convertToCivilianTime, appendAMPM, doubleDigits); /***/ }) /******/ ]); \ No newline at end of file diff --git a/chapter-07/mounting-lifecycle-clock/src/clock.js b/chapter-07/mounting-lifecycle-clock/src/clock.js index 706ac234..cadbc08c 100644 --- a/chapter-07/mounting-lifecycle-clock/src/clock.js +++ b/chapter-07/mounting-lifecycle-clock/src/clock.js @@ -21,7 +21,7 @@ export default class Clock extends Component { } render() { - const { hours, minutes, seconds, timeOfDay } = this.state + const { hours, minutes, seconds, ampm } = this.state return (
{hours} @@ -29,10 +29,10 @@ export default class Clock extends Component { {minutes} : {seconds} - {timeOfDay} + {ampm}
) } -} \ No newline at end of file +} diff --git a/chapter-07/mounting-lifecycle-clock/src/lib.js b/chapter-07/mounting-lifecycle-clock/src/lib.js index f1b5ff7c..d51d27a5 100644 --- a/chapter-07/mounting-lifecycle-clock/src/lib.js +++ b/chapter-07/mounting-lifecycle-clock/src/lib.js @@ -19,7 +19,7 @@ export const civilianHours = clockTime => export const appendAMPM = clockTime => ({ ...clockTime, - ampm: (clockTime.hours >= 12) ? "PM" : "AM" + ampm: (clockTime.hours >= 12) ? "pm" : "am" }) export const prependZero = key => clockTime => @@ -54,5 +54,6 @@ export const getClockTime = compose( getCurrentTime, abstractClockTime, convertToCivilianTime, + appendAMPM, doubleDigits -) \ No newline at end of file +) diff --git a/chapter-07/readme.md b/chapter-07/readme.md index a490778e..173a4b06 100644 --- a/chapter-07/readme.md +++ b/chapter-07/readme.md @@ -48,4 +48,4 @@ Samples ### Managing State Outside of React 1. Clock without React State ([demo](https://rawgit.com/MoonHighway/learning-react/master/chapter-07/06-managing-state-outside-react/01-state.html), [code](http://github.com/MoonHighway/learning-react/blob/master/chapter-07/06-managing-state-outside-react/01-state.html), [bin](http://jsbin.com/juxewiw/1/edit?js,output)) - 2. Flux ([bin only](http://jsbin.com/juxewiw/2/edit?js,console,output)) + 2. Flux ([demo](https://rawgit.com/MoonHighway/learning-react/master/chapter-07/06-managing-state-outside-react/02-flux.html), [code](http://github.com/MoonHighway/learning-react/blob/master/chapter-07/06-managing-state-outside-react/02-flux.html), [bin](http://jsbin.com/juxewiw/2/edit?js,console,output)) diff --git a/chapter-11/company-website/package.json b/chapter-11/company-website/package.json index 96f78424..e9af5685 100644 --- a/chapter-11/company-website/package.json +++ b/chapter-11/company-website/package.json @@ -4,7 +4,8 @@ "description": "A React Router tutorial.", "main": "index.js", "scripts": { - "start": "opener http://localhost:3000 & webpack-dev-server" + "start": "opener http://localhost:3000 & webpack-dev-server", + "build": "webpack --progress" }, "author": "Eve Porcello (http://www.moonhighway.com)", "license": "MIT", diff --git a/chapter-11/company-website/src/index.js b/chapter-11/company-website/src/index.js index cf29e6e7..3d98a0bb 100644 --- a/chapter-11/company-website/src/index.js +++ b/chapter-11/company-website/src/index.js @@ -24,10 +24,10 @@ render(
- +