This file contains hidden or 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 { observer } from 'mobx-react'; | |
| import DevTools from 'mobx-react-devtools'; | |
| @observer | |
| export default class App extends Component { | |
| state = { | |
| value: '', | |
| }; |
This file contains hidden or 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 ImageError from 'app/components/image/ImageError'; | |
| type Props = { | |
| src: string, | |
| }; | |
| type State = { | |
| hasError: boolean, | |
| }; |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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() { |