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 ReactDOM from 'react-dom' | |
| import { Key } from '../utils/keyboardUtils' | |
| export default class FocusManager extends React.Component { | |
| constructor(props) { | |
| super(props) | |
| this._immediateID = null | |
| this.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
| // pattern 1 | |
| await Promise.all( | |
| files.map(async file => { | |
| let fileSize = await getSize(file); | |
| totalSize += fileSize; | |
| }) | |
| ); | |
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
| // ======================================================= | |
| // Poller.js | |
| // ======================================================= | |
| const EventEmitter = require('events'); | |
| class Poller extends EventEmitter { | |
| /** | |
| * @param {int} timeout how long should we wait after the poll started? | |
| */ | |
| constructor(timeout = 100) { |