...
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
/** Types vs Interfaces */ | |
type Configuration = { | |
baseUrl: string; | |
ttl: number; | |
}; | |
type ConfigWithCredentials = Configuration & { | |
credentials: { | |
username: string; |
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 React = require('react'); | |
const { useState, useEffect, useReducer } = require('react'); | |
const { render, Box, Text, useInput, useApp, useFocus } = require('ink'); | |
const useStdoutDimensions = require('ink-use-stdout-dimensions'); | |
const Key = ({ children, onSelect }) => { | |
const { isFocused } = useFocus(); | |
useInput((input, key) => { | |
if (key.return && isFocused) { | |
onSelect(); |
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 assignResult(name) { | |
return assign({ | |
results: (context, event) => { | |
console.log(event); | |
return { ...context.results, [name]: event.data }; | |
}, | |
}); | |
} | |
const log = (context, event) => { |
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 ModeEvents = { | |
showWelcome: 'SHOW_WELCOME', | |
showClosedCaptioning: 'SHOW_CLOSED_CAPTIONING', | |
showResources: 'SHOW_RESOURCES', | |
showSchedule: 'SHOW_SCHEDULE', | |
showInstaller: 'SHOW_INSTALLER', | |
showCheatMode: 'SHOW_CHEAT_MODE', | |
showTest: 'SHOW_TEST', | |
showDemos: 'SHOW_DEMOS', |
OlderNewer