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 firstResolved (promises) { | |
| // https://stackoverflow.com/a/37235274 | |
| // This is a classic example where inverting your logic makes it much clearer. | |
| // Your "race" in this case is that you want your rejection behavior to in | |
| // fact be success behavior. | |
| // If a request fails, count that as a resolution so it will keep waiting | |
| // for other possible successes. If a request succeeds, treat it as a | |
| // rejection so Promise.all immediately bails out. | |
| promises = promises.map(p => p.then( |
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
| /* container */ | |
| .flex { display: flex; } | |
| /* direction */ | |
| .flex-col { flex-direction: column; } | |
| .flex-row { flex-direction: row; } | |
| .flex-col-r { flex-direction: column-reverse; } | |
| .flex-row-r { flex-direction: row-reverse; } | |
| /* wrap */ |
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
| .m-xs { margin: 5px; } | |
| .m-sm { margin: 10px; } | |
| .m { margin: 15px; } | |
| .m-md { margin: 20px; } | |
| .m-lg { margin: 30px; } | |
| .m-n { margin: 0; } | |
| .m-l-none { margin-left: 0; } | |
| .m-l-xs { margin-left: 5px; } | |
| .m-l-sm { margin-left: 10px; } | |
| .m-l { margin-left: 15px; } |
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
Show hidden characters
| [ | |
| {"command": "insert", "args": {"characters": "\n\n"} }, | |
| {"command": "move", "args": {"by": "lines", "forward": false} }, | |
| {"command": "move_to", "args": {"to": "hardeol", "extend": false} }, | |
| {"command": "reindent", "args": {"single_line": true} }, | |
| {"command": "insert", "args": {"characters": "\t"} } | |
| ] |