WatchMeCode

Node.js and JavaScript Screencasts for Back-End Developers

  • Catalog
  • Log In
WatchMeCode Episode

Promises, From The Ground Up

October 22, 2013
Episode Duration: 21:27

Not A WatchMeCode Subscriber?

Sign up now and get instant access to this episode,
plus all episodes in the full WatchMeCode catalog!

Get Your All-Access Pass »

“I needed to change the flow of code and add some new features, but I found myself stuck. I couldn’t understand the code that I had written.” – Derick Bailey (yes, ME!)

Tired of writing deeply nested callback structures, only to realize later that you can't understand the control flow of the code? Looking for a better way to organize your asynchronous code, without callback hell

Enter, promises.

Promises provide a way to organize asynchronous JavaScript without creating “callback hell” or the “christmas tree of doom”. They provde structure and flow control to an otherwise messy codebase. They also allow you to register your callback functions whenever you want – even after the asynchronous code has already completed!

But you've looked at promises already, right? You've used them a few times – and with success! But you're still banging your head against a wall, stuck trying to understand what promises really do?

I understand. Really, I do. I re-invented this wheel by accident, before I realized what promises would do for me. And you know what? I'm glad I did! Building my own promises library was the best way for me to learn what they are, how they work and why we need them. And now you can benefit from this learning experience, too!

In less than 22 minutes, this screencast will teach you:

  • how promises are are built and how they work behind the scenes
  • how you can register callbacks after the async code returns
  • how to register multiple callbacks, ensuring each is only called once
  • how to pass data from the promise to the callbacks

You'll see the person behind the curtain and realize that it's not magic. You'll build a promise, from the ground up, to learn what they do and why. Come shatter the illusion of magic and reveal the simple and powerful API of promises by creating one for yourself!

Filed Under: Callbacks, Episodes, JavaScript, Promises

About derickbailey

Derick Bailey is an entrepreneur, problem solver (and creator? :P ), software developer, screecaster, writer, blogger, speaker and technology leader in central Texas (north of Austin).

WMC Site Navigation

  • Catalog
  • #slack
  • Screencasts
  • Interviews
  • eBooks
  • Member Discounts
  • Github
  • About WatchMeCode

Content License

WatchMeCode episodes take a lot of time and effort to build. Please support my efforts by not distributing copies to your friends or coworkers (within reason). You are not allowed to redistribute or sell any materials found on the WatchMeCode site, without permission. A ... [Continue Reading]

Derick Bailey Around The Web

  • DerickBailey.com
  • My books @ Leanpub
  • Entreprogrammers
  • @derickbailey
  • +DerickBailey

Copyright © 2016 Muted Solutions, LLC. All Rights Reserved · Log in