Syntax - Tasty Web Development Treats
765: JS Promises Fundamentals - Part 1

765: JS Promises Fundamentals - Part 1

Syntax - Tasty Web Development Treats

22:00

About this episode

In this 3-course series, Scott and Wes serve up some JavaScript Promises treats. In part 1, they unravel the concept of promises and delve into common examples of their usage, from creating and waiting on promises, to database queries and user permissions.
Show Notes 00:00 Welcome to Syntax!
01:27 Brought to you by Sentry.io.
02:32 What is a promise?
Promise mdn web docs.
03:27 Common examples of promises. 03:45 A fetch call to an API returns a promise.
05:54 A database query or Insert command
07:18 A request for user permissions.
07:37 A wait function.

08:08 Resolve or rejecting promises.
09:33 Creating promises. 09:46 New promise.
11:09 Promise.withResolvers().
11:37 An async function.

14:34 Waiting on a promise. 15:09 .then().
16:50 Await.
17:44 Why use one wait method over the other?

Hit us up on Socials! Syntax: X Instagram Tiktok LinkedIn Threads
Wes: X Instagram Tiktok LinkedIn Threads
Scott:X Instagram Tiktok LinkedIn Threads
Randy: X Instagram YouTube Threads

More from Syntax - Tasty Web Development Treats

Scott and Wes get into closing the gap between your taste and your skills, with tips on design inspiration, snappier animations and easing. They also share an entry-level setup for recording video les…

1h 6m

Scott and CJ dig into Exact, Expo’s new Rust-based runtime that takes one codebase to web, iOS, macOS and Linux with no React Native involved, plus Bombadil’s property-based testing for web UIs. They…

1h 11m

Scott and Wes sit down with Michael Arnaldi to dig into Effect v4 and why guardrails matter now that AI agents are writing so much of our code. They discuss going zero dependencies, a 5x smaller bundl…

50m

Scott and Wes sit down with GitHub’s Kyle Daigle to ask what the hell is going on with GitHub: the downtime, the agent traffic spike, and the infrastructure overhaul decoupling storage from compute. P…

31m

Wes, Scott, and CJ are back with two weeks of news: Reddit is forcing everyone to log in, r/opensource bans anything AI, and CSS-Tricks is independent again. Plus Anomaly's Hex dictation app, Mitchell…

1h 35m