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 { Link } from 'react-router'; | |
type Props = {}; | |
export default function Facet({ | |
property, | |
value, | |
label, | |
...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 styles from './feed.scss'; | |
type Props = { | |
data: Array<{ id: string }>, | |
threshold: number, | |
children: (item: { id: string }, index: number) => React.Element<any>, | |
}; | |
export default class Feed extends Component { |
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'; | |
type Props = { | |
value: ?string, | |
onChange: ?() => {}, | |
onStopTyping: ?() => void, | |
onStartTyping: ?() => void, | |
}; | |
type State = { |
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
export function toggleFullscreen(element: HTMLElement = document) { | |
const isFullscreen = [ | |
document.fullscreenElement, | |
document.webkitFullscreenElement, | |
document.mozFullScreenElement, | |
document.msFullscreenElement, | |
].some(Boolean); | |
if (!isFullscreen) { | |
if (element.requestFullscreen) { |
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
function generatePosters(files: [File]) { | |
return async dispatch => { | |
for (const { data, id } of files) { | |
const poster = await generatePoster(data); | |
dispatch({ | |
type: GENERATE_POSTER, | |
payload: { id, poster }, | |
}); | |
} | |
} |
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
Promise.all([ | |
import("react"), | |
import("react-dom"), | |
import("react-router"), | |
import("react-router-redux"), | |
import("source/store"), | |
import("containers/Root"), | |
import("source/index.css"), | |
import("whatwg-fetch"), | |
import("babel-polyfill"), |
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, PropTypes } from 'react'; | |
export default class LazilyLoad extends Component { | |
static propTypes = { | |
modules: PropTypes.object, | |
children: PropTypes.func.isRequired, | |
}; | |
static defaultProps = { modules: {} }; |
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
async function request(...args) { | |
try { | |
await makeRequest(...args); | |
} catch (e) { | |
await getRefreshToken(); | |
// try to re-request the previous asset | |
} | |
} | |
async function getRefreshToken() { |
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
async function getX() { | |
let users = []; | |
try { | |
x = await getUsers(); | |
} catch (e) { } | |
return x; | |
} | |
// vs |
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 path = require('path'); | |
const webpack = require('webpack'); | |
const HTMLPlugin = require('webpack-html-plugin'); | |
const CleanWebpackPlugin = require('clean-webpack-plugin'); | |
const ExtractTextPlugin = require('extract-text-webpack-plugin'); | |
const basePath = path.resolve(__dirname, './app/'); | |
const outPath = path.resolve(__dirname, './dist'); | |
module.exports = { |