Skip to content

Instantly share code, notes, and snippets.

@jrsinclair
Created December 5, 2018 22:07
Show Gist options
  • Save jrsinclair/fe027c031f4f6077069dcfdd3cd02e20 to your computer and use it in GitHub Desktop.
Save jrsinclair/fe027c031f4f6077069dcfdd3cd02e20 to your computer and use it in GitHub Desktop.
Elegant Error Handling Code Samples
function csvToMessages(csvData) {
const csvRows = splitCSVToRows(csvData);
const headerFields = csvRows.map(_.head).map(splitFields);
const dataRows = csvRows.map(_.tail);
// How will we pass headerFields and dataRows to
// processRows() ?
const funcInEither = headerFields.map(processRows);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment