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 sleep(ms: number) { | |
| return new Promise((resolve, reject) => { | |
| setTimeout(() => resolve(), ms) | |
| }) | |
| } | |
| async function randomDelay() { | |
| const randomTime = Math.round(Math.random() * 1000) | |
| return sleep(randomTime) | |
| } |
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
| // connect() is a function that injects Redux-related props into your component. | |
| // You can inject data and callbacks that change that data by dispatching actions. | |
| function connect(mapStateToProps, mapDispatchToProps) { | |
| // It lets us inject component as the last step so people can use it as a decorator. | |
| // Generally you don't need to worry about it. | |
| return function (WrappedComponent) { | |
| // It returns a component | |
| return class extends React.Component { | |
| render() { | |
| return ( |
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
| #!/usr/bin/env node | |
| 'use strict'; | |
| var beautify = require('json-beautify'); | |
| var fs = require('fs'); | |
| var ip = require('ip'); | |
| var strftime = require('strftime'); | |
| var Handlebars = require('handlebars'); | |
| var buildType = process.argv[process.argv.length - 1] |