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
'use strict'; | |
// Do this as the first thing so that any code reading it knows the right env. | |
process.env.BABEL_ENV = 'development'; | |
process.env.NODE_ENV = 'development'; | |
// Makes the script crash on unhandled rejections instead of silently | |
// ignoring them. In the future, promise rejections that are not handled will | |
// terminate the Node.js process with a non-zero exit code. | |
process.on('unhandledRejection', err => { |
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
'use strict'; | |
const errorOverlayMiddleware = require('react-dev-utils/errorOverlayMiddleware'); | |
const noopServiceWorkerMiddleware = require('react-dev-utils/noopServiceWorkerMiddleware'); | |
const path = require('path'); | |
const config = require('./webpack.config.dev'); | |
const paths = require('./paths'); | |
const express = require('express'); | |
const protocol = process.env.HTTPS === 'true' ? 'https' : 'http'; |
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
'use strict'; | |
const autoprefixer = require('autoprefixer'); | |
const path = require('path'); | |
const webpack = require('webpack'); | |
const HtmlWebpackPlugin = require('html-webpack-plugin'); | |
const CaseSensitivePathsPlugin = require('case-sensitive-paths-webpack-plugin'); | |
const InterpolateHtmlPlugin = require('react-dev-utils/InterpolateHtmlPlugin'); | |
const WatchMissingNodeModulesPlugin = require('react-dev-utils/WatchMissingNodeModulesPlugin'); | |
const eslintFormatter = require('react-dev-utils/eslintFormatter'); |
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 List = ({ items, onClick }) => ( | |
<ul> | |
{items.map(item => ( | |
<ClickHandler key={item.id} data={item} onClick={onClick}> | |
{(handleClick) => ( | |
<li onClick={handleClick}> | |
{item.text} | |
</li> | |
)} | |
</ClickHandler> |
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 List = ({ items, onClick }) => ( | |
<ul> | |
{items.map(item => ( | |
<li onClick={() => onClick(item)}> | |
{item.text} | |
</li> | |
))} | |
</ul> | |
) |
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 List = ({ items, onClick }) => ( | |
<ul> | |
{items.map(item => ( | |
<li> | |
{item.text} | |
</li> | |
))} | |
</ul> | |
) |
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 CacheClientPromise from 'cache-client-promise' | |
const myCache = new CacheClientPromise(); | |
[{ | |
id: 1234, | |
title: 'test', | |
view: 'two-column' | |
}, | |
{ |
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
[{ | |
id: 1234, | |
title: 'test', | |
view: 'two-column' | |
}, | |
{ | |
id: 1234, | |
title: 'test', | |
view: 'image-only' | |
}] |
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
// @flow | |
import React from 'react' | |
import classnames from 'classnames' | |
import type { ButtonT } from './ButtonT' | |
const Button = ({ className, type = 'button', text, tabIndex, onClick = () => {}, disabled = false }: ButtonT) => ( | |
<button | |
className={classnames('button', className)} | |
type={type} |
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
componentWillReceiveProps (nextProps) { | |
// see if new content was found by the service worker | |
if (nextProps.serviceWorker.serviceWorkerUpdated) { | |
this.setState({ | |
notifications: this.state.notifications.concat({ | |
'The app has been updated! Hooray! Refresh your browser to enjoy the latest and greatest', | |
'some unique key', | |
action: 'Dismiss', | |
dismissAfter: 4000, | |
onClick: this.removeNotification |
NewerOlder