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
[Ll]ibrary/ | |
[Tt]emp/ | |
[Oo]bj/ | |
[Bb]uild/ | |
# Autogenerated VS/MD solution and project files | |
/*.csproj | |
/*.unityproj | |
/*.sln | |
/*.suo |
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 gulp = require('gulp'); | |
const browserify = require('browserify'); | |
const babelify = require('babelify'); | |
const source = require('vinyl-source-stream'); | |
const uglify = require('gulp-uglify'); | |
const streamify = require('gulp-streamify'); | |
gulp.task('build:debug', () => { | |
return browserify({ entries: 'js/app.js', debug: true }) | |
.transform('babelify', { presets: ['es2015', '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
"jest": { | |
"automock": false, | |
"moduleNameMapper": { | |
"^.+\\.(css|less)$": "<rootDir>/test/styleMock.js", | |
"^.+\\.(png|jpg|jpeg|gif|svg|woff|woff2|ttf|eot)$": "<rootDir>/test/fileMock.js" | |
} | |
} |
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 webpack = require('webpack'); | |
const ExtractTextPlugin = require('extract-text-webpack-plugin'); | |
const HtmlWebpackPlugin = require('html-webpack-plugin'); | |
module.exports = { | |
entry: [ 'whatwg-fetch', './js/app.js' ], | |
output: { | |
filename: 'bundle.js', | |
path: __dirname + '/dist', | |
publicPath: '/' |
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 webpack = require('webpack'); | |
const ExtractTextPlugin = require('extract-text-webpack-plugin'); | |
const HtmlWebpackPlugin = require('html-webpack-plugin'); | |
module.exports = { | |
entry: [ 'whatwg-fetch', './js/app.js' ], | |
// Render source-map file for final build | |
devtool: 'source-map', | |
output: { | |
filename: '[name].js', |
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
// Enhanced BlogPost component | |
export default withSubscription(BlogPost, (DataSource, props) => | |
DataSource.getBlogPost(props.id) | |
); | |
// Enhanced CommentList component | |
export default withSubscription(CommentList, DataSource => | |
DataSource.getComments() | |
); |
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, { Component } from "react"; | |
import DataSource from "../DataSource"; | |
const TextBlock = ({ text }) => <>{text}</>; | |
export class BlogPost extends Component { | |
constructor(props) { | |
super(props); | |
this.state = { | |
data: DataSource.getBlogPost(props.id) |
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
Show hidden characters
import React, { Component } from "react"; | |
import DataSource from "../DataSource"; | |
const Comment = ({ comment }) => <>{comment}</>; | |
export class CommentList extends Component { | |
constructor(props) { | |
super(props); | |
this.state = { | |
data: DataSource.getComments() |
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, { Component } from "react"; | |
import DataSource from "../DataSource"; | |
export default function withSubscription(Component, selectData) { | |
return class extends Component { | |
constructor(props) { | |
super(props); | |
this.state = { | |
data: selectData(DataSource, props) | |
}; |
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, { Component } from "react"; | |
-import DataSource from "../DataSource"; | |
+import withSubscription from "./withSubscription"; | |
const TextBlock = ({ text }) => <>{text}</>; | |
class BlogPost extends Component { | |
- constructor(props) { | |
- super(props); | |
- this.state = { |
OlderNewer