Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Async patterns in javascript

285 views

Published on

A presentation on async patterns given in WDC-IL

Published in: Software
  • Be the first to comment

  • Be the first to like this

Async patterns in javascript

  1. 1. Fulfill the promise Async patterns with javascript Ran Wahle
  2. 2. A little about myself  Fullstack developer at Global-E  Enthusiastic front-end developer  Poor UI designer
  3. 3. What will we see today?  Using Events and good old XHR  Callbacks with Socket.IO  Promise patterns (and standards)  Observables  Iterators & generators  Async / AWAIT  Angular 2 and async
  4. 4. Using Events • Trigger • Handle
  5. 5. Socket.IO Events  .on(‘topic’, hander)  .emit(‘topic’, args)
  6. 6. Promise patterns  Used for one time callback  Has many implementations jQuery.AJAX , angularJs, backbone & more
  7. 7. Promise creation demo
  8. 8. Es2015 promise  One standard (No more “Success”)  Native javascript implementation  Native support in new APIs
  9. 9. Using Fetch API
  10. 10. Generators & Iterrators  Using array methods asynchronously  function*  yield
  11. 11. ES2015 iterators
  12. 12. TS async await  Writing asynchronously with “synchronous” syntax  await keyword “turns” a promise to its resolved value
  13. 13. TS Async / Await
  14. 14. Lets wrap  Events  Promise implementation for ES5  Promises in ES6  Iterators & Generators  async & await (TS)
  15. 15. Thanks Ran Wahle http://blogs.microsoft.co.il/ranw Twitter: @ranwahle Ran.wahle@gmail.com Linkedin : https://il.linkedin.com/in/ranwahle

×