/js-cookbook

Some common recipes I've used across multiple JS/TS projects.

Primary LanguageJavaScriptGNU General Public License v3.0GPL-3.0

JS Cookbook

Note: This is a work in progress.

This is a cookbook of recipes that I use (or have used) across multiple JS/TS projects.

  1. Try-Catch made simpler
  2. Promise.then.catch.finally made simpler
  3. Extracting keys from a list of objects
  4. Extract and flatten an object
  5. Enrich an object with properties of another object
  6. Make it faster to access more info about an id
  7. Piping through functions that can throw an exception
  8. Safe, simple, sequential promises
  9. Trigger a file download
  10. Parallel promises made simple
  11. Advanced switch-case a.k.a Pattern Matching