(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| /* | |
| * Refactor f to use Promises instead of callbacks | |
| */ | |
| const f = (firstName, callback) => { | |
| setTimeout(() => { | |
| if (!firstName) return callback(new Error('firstName is required')) | |
| const fullName = `${firstName} Smith` | |
| return callback(fullName) | |
| }, 2000) | |
| } |
| const { spawn } = require('child_process') | |
| const chalk = require('chalk') | |
| const { MultiSelect } = require('enquirer') | |
| const { lstatSync, readdirSync } = require('fs') | |
| const { join } = require('path') | |
| const getDirectories = source => | |
| readdirSync(source).map(name => | |
| join(source, name)).filter(source => lstatSync(source).isDirectory()) |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.