This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"lastUpload":"2017-11-07T21:21:29.582Z","extensionVersion":"v2.8.5"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//////////////////////////////////////////////////////////////////////////////// | |
// Exercise: | |
// | |
// Make `withMouse` a "higher-order component" that sends the mouse position | |
// to the component as props. | |
// | |
// Hint: use `event.clientX` and `event.clientY` | |
// | |
// Got extra time? | |
// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react' | |
import ReactDOM from 'react-dom' | |
import PropTypes from 'prop-types' | |
import './styles.css' | |
const { func, any } = PropTypes | |
//////////////////////////////////////////////////////////////////////////////// | |
// Requirements |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
const { string, object, arrayOf, func } = PropTypes; | |
Component.propTypes = { | |
value: string, | |
starships: arrayOf(object).isRequired, | |
name: string, | |
onChange: func.isRequired, | |
}; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var gulp = require('gulp'); | |
var streamify = require('gulp-streamify'); | |
var uglify = require('gulp-uglify'); | |
var notify = require('gulp-notify'); | |
var gutil = require('gulp-util'); | |
var less = require('gulp-less'); | |
var rename = require('gulp-rename'); | |
var nodemon = require('gulp-nodemon'); | |
var jshint = require('gulp-jshint'); | |
var react = require('gulp-react'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// require() some stuff from npm (like you were using browserify) | |
// and then hit Rebuild to run it on the right | |
var B = require('bluebird'); | |
function throwError() { | |
var deferred = B.defer(); | |
if (true) { | |
return B.reject(new Error('Exception')); | |
} | |
(function () { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var gulp = require('gulp'); | |
var browserify = require('browserify'); | |
var watchify = require('watchify'); | |
var streamify = require('gulp-streamify'); | |
var cssMin = require('gulp-css'); | |
var uglify = require('gulp-uglify'); | |
var notify = require('gulp-notify'); | |
var to5ify = require('6to5ify'); | |
var source = require('vinyl-source-stream'); | |
var webserver = require('gulp-webserver'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// require() some stuff from npm (like you were using browserify) | |
// and then hit Rebuild to run it on the right | |
var B = require('bluebird'); | |
function throwError() { | |
var deferred = B.defer(); | |
(function () { | |
throw new Error('Exception'); | |
})() | |
return deferred.promise; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Earlier | |
var B = require('bluebird'); | |
//Later | |
/** | |
* Promise wrapper for fs.watch | |
* @param path | |
* @returns {*} | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Earlier | |
var H = require('highland'); | |
//Later | |
/** | |
* Wrapper for fs.watch | |
* @param path | |
* @returns {*} | |
*/ |
NewerOlder