Upgrade to Pro — share decks privately, control downloads, hide ads and more …

You don't know Promises - IT Konekt April 2019

You don't know Promises - IT Konekt April 2019

Ivan Jovanovic

April 20, 2019
Tweet

More Decks by Ivan Jovanovic

Other Decks in Technology

Transcript

  1. I am Ivan Jovanovic Senior Software Engineer, Tech Speaker You

    can find me at @ivanjov96 or https://ivanjov.com Hello! IJ Consulting
  2. JavaScript is strange because ‒ It was built for 10

    days ‒ It has one thread ‒ It is synchronous and asynchronous ‒ It is everywhere ‒ It is different
  3. “ A callback is a function that is passed as

    an argument and will be executed after another function has finished executing.
  4. “ The Promise object represents the eventual completion (or failure)

    of an asynchronous operation, and its resulting value.
  5. Microtask queue ‒ Independent queue ‒ Used by: process.nextTick, Promises,

    Object.observe, MutationObserver ‒ Faster than the main queue and may be drained several times in a single event loop tick
  6. Conclusion ‒ JS is crazy and great at the same

    time! ‒ Async behavior is a pro, not a con. ‒ Be careful when using Promises, it's great and dangerous at the same time!