JS Async - atabegruslan/Notes GitHub Wiki

Ways

Callbacks

  • nesting prob

ES2016 Promises

  • nesting prob

ES2016 Generators (and Coroutines)

  • Syntactic sugar over Promises
  • Need corouting libs.
  • Generator by itself is like Goto

ES2017 Async and Await

  • Syntactic sugar over Promises
  • Not yet native
    • Majority of ES7 features including async/await have not been natively implemented (11 July 2016).
    • Native in current Chrome, Node.js but still needs to be transpiled with Babel for most projects (8 Mar 2018).

Bad way:

RxJS (ReactiveX) Observables

Idea of Pull vs Push

Async in Vue

  1. vue-async-function: https://xebia.com/blog/next-generation-async-functions-with-vue-async-function/
  2. transform-regenerator & polyfill: https://stackoverflow.com/questions/46389267/using-async-await-with-webpack-simple-configuration-throwing-error-regeneratorr/46734082
  3. Bluebird: https://github.com/atabegruslan/Travel-Blog-Laravel-5-8/commit/9d710ec1b307a5922bf35304e260ff758f5e79ea

Good reads


Workers

⚠️ **GitHub.com Fallback** ⚠️