Summary of Broken Promises - James Snell, NearForm

This is an AI generated summary. There may be inaccuracies.
Summarize another video · Purchase summarize.tech Premium

00:00:00 - 00:30:00

In this video, James Snell discusses some common issues with promises and callbacks, and provides a solution. He explains that promises should be used for synchronous tasks, and callbacks should be used for asynchronous tasks. He also discusses the use of trace events to monitor the execution of code, and the dangers of promises resolving within the same event as other promises.

  • 00:00:00 This YouTube video explains why promises are often used wrong, and how to avoid breaking promises when coding. The talk focuses on examples of code that use promises incorrectly, and how to fix them.
  • 00:05:00 In the video, James Snell demonstrates how broken promises can lead to memory leaks, resource leaks, and other problems. He also shows how to avoid these issues by using capture rejections in event emitters.
  • 00:10:00 In this video, James Snell discusses some common issues with promises and callbacks, and provides a solution. If you're going to be using promises and callbacks, go all in on promises. If you're going to be mixing them, it gets complicated.
  • 00:15:00 In this video, James Snell explains the difference between promises and callbacks, and how promises propagate errors properly. He also shows how to use util-promise to create promise-based error handlers.
  • 00:20:00 In this video, James Snell explains how to create long chains of promises using the next() function. This practice is often used to synchronously iterate over a large JSON file. However, this process is wasteful because it consumes a lot of memory and speed performance.
  • 00:25:00 This video discusses how promises can cause a synchronous event loop block, and offers a solution of throwing more servers into the mix.
  • 00:30:00 In this video, James Snell explains the difference between promises and callbacks, and offers some basic rules for writing code that is executed asynchronously. He also discusses the use of trace events to monitor the execution of code, and the dangers of promises resolving within the same event as other promises.

Copyright © 2024 Summarize, LLC. All rights reserved. · Terms of Service · Privacy Policy · As an Amazon Associate, summarize.tech earns from qualifying purchases.