Skip to content

Advanced JavaScript

Pritesh Patel edited this page May 22, 2019 · 1 revision

https://app.pluralsight.com/library/courses/advanced-javascript/

Async Patterns

Callbacks

  • an async pattern - can lead to "callback hell" - callback nesting or continuation style
  • callback/continuation leads to inversion of control (e.g. consider calling a third-party lib and passing it a callback)

Solving Callback Problems

  • separate callbacks
  • node-style / error-first style
  • nested-callback tasks

Generators

  • ...

Promises pattern

  • McDonalds order metaphor
  • "continuation events" metaphor
  • handing back a promise "un-inverted" the inversion of control of callbacks
  • Promise are built-in as of ES6
Clone this wiki locally