Tag

Promise

0 views collected around this technical thread.

Rare Earth Juejin Tech Community
Rare Earth Juejin Tech Community
Apr 6, 2025 · Frontend Development

Error Handling Strategies for async/await in JavaScript

This article explains the fundamentals of async/await in JavaScript, compares it with callbacks and promises, and presents various error‑handling approaches such as try/catch, Promise.catch, combined await‑catch, and global rejection listeners, helping developers choose the most suitable strategy for their projects.

Async/AwaitError HandlingJavaScript
0 likes · 9 min read
Error Handling Strategies for async/await in JavaScript
Rare Earth Juejin Tech Community
Rare Earth Juejin Tech Community
Jan 19, 2025 · Fundamentals

Step‑by‑Step Guide to Implementing a Custom Promise in JavaScript

This article provides a comprehensive, step‑by‑step tutorial on hand‑coding a JavaScript Promise class, covering its initial structure, state management, then method, error handling, asynchronous execution, callback queuing, and chainable behavior with complete code examples.

AsyncJavaScriptPromise
0 likes · 16 min read
Step‑by‑Step Guide to Implementing a Custom Promise in JavaScript
Rare Earth Juejin Tech Community
Rare Earth Juejin Tech Community
Jan 12, 2025 · Frontend Development

Understanding and Implementing Vue's nextTick Mechanism

This article explains the inner workings of Vue's nextTick function, detailing its callback queue, flushing logic, timer selection across environments, Promise‑based return, and provides a step‑by‑step JavaScript implementation with test cases and the full Vue source code.

AsyncJavaScriptMicrotasks
0 likes · 10 min read
Understanding and Implementing Vue's nextTick Mechanism
Rare Earth Juejin Tech Community
Rare Earth Juejin Tech Community
Jul 29, 2024 · Frontend Development

Ensuring a Single Token Request Across Multiple API Calls with a repeatOnce Function

This article explains how to prevent multiple simultaneous token requests in a web application by using a custom repeatOnce function that caches the token in localStorage and coordinates pending calls through an event emitter, ensuring only the first request fetches the token while others wait for its result.

AxiosConcurrencyJavaScript
0 likes · 5 min read
Ensuring a Single Token Request Across Multiple API Calls with a repeatOnce Function
Code Mala Tang
Code Mala Tang
Jul 7, 2024 · Frontend Development

How to Control Concurrent Requests with a Custom Promise Limiter in JavaScript

This article explains why browsers limit concurrent HTTP requests, demonstrates the limitation with a test example, and provides a reusable PromiseLimiter class that queues and throttles asynchronous calls to keep the number of simultaneous requests under a defined threshold.

AsyncConcurrencyJavaScript
0 likes · 5 min read
How to Control Concurrent Requests with a Custom Promise Limiter in JavaScript
Rare Earth Juejin Tech Community
Rare Earth Juejin Tech Community
Jun 8, 2024 · Backend Development

vowlink: A Lightweight Go Functional Programming Library for Simplifying Complex if‑else Logic

This article introduces vowlink, a Go library that adopts JavaScript‑style Promise concepts to replace tangled if‑else statements with chainable, error‑handled functional constructs, providing a concise, efficient solution for backend developers facing growing business logic complexity.

Functional ProgrammingGoPromise
0 likes · 15 min read
vowlink: A Lightweight Go Functional Programming Library for Simplifying Complex if‑else Logic
Rare Earth Juejin Tech Community
Rare Earth Juejin Tech Community
May 27, 2024 · Backend Development

Vowlink: A Lightweight Go Functional Programming Library for Simplifying Complex if‑else Logic

Vowlink is a lightweight Go library that introduces Promise‑like functional programming constructs—such as Then, Catch, Finally, Race, and All—to replace tangled if‑else statements, offering chainable calls, error handling, and concurrency control, thereby improving code readability, maintainability, and execution efficiency for backend services.

Functional ProgrammingGoPromise
0 likes · 15 min read
Vowlink: A Lightweight Go Functional Programming Library for Simplifying Complex if‑else Logic
Code Mala Tang
Code Mala Tang
May 7, 2024 · Frontend Development

Simplify Async Flow with Promise.withResolvers and Promise.try in JavaScript

This article explains how Promise.withResolvers and Promise.try streamline asynchronous control in JavaScript, providing clearer code for handling resolve/reject logic, event aggregation, and unified error handling with practical code examples.

Async ControlJavaScriptPromise
0 likes · 5 min read
Simplify Async Flow with Promise.withResolvers and Promise.try in JavaScript
Rare Earth Juejin Tech Community
Rare Earth Juejin Tech Community
Mar 24, 2024 · Frontend Development

Implementing Concurrency Limits in JavaScript Using Promise, Callbacks, and RxJS

The article demonstrates how to control the number of simultaneous HTTP requests in JavaScript by presenting three implementation styles—Promise, callback, and RxJS—along with real‑world examples, code snippets, and a discussion of their advantages and drawbacks.

ConcurrencyJavaScriptPromise
0 likes · 13 min read
Implementing Concurrency Limits in JavaScript Using Promise, Callbacks, and RxJS
Rare Earth Juejin Tech Community
Rare Earth Juejin Tech Community
Dec 23, 2023 · Frontend Development

Implementing Cancellation and Progress Notification for JavaScript Promises

This article examines advanced JavaScript Promise techniques by presenting practical implementations for cancelling a pending promise and for notifying progress during asynchronous operations, complete with code examples, explanations of underlying concepts, and discussion of their relevance in interviews and real‑world development.

CancellationJavaScriptProgress
0 likes · 10 min read
Implementing Cancellation and Progress Notification for JavaScript Promises
New Oriental Technology
New Oriental Technology
Nov 17, 2023 · Frontend Development

axios introduction

Axios is a popular HTTP client for JavaScript that simplifies making HTTP requests, supports promise-based APIs, and offers features like request/response interceptors and automatic JSON data transformation.

AxiosHTTP ClientInterceptors
0 likes · 9 min read
axios introduction
ByteFE
ByteFE
Oct 18, 2023 · Frontend Development

Using React’s Built‑in Features to Handle Loading and Error States with Promises

This article explains how to display loading and error states in React by passing Promise objects through props, context, or state libraries, leveraging Suspense, ErrorBoundary, and custom hooks such as usePromise and use to simplify asynchronous UI patterns while avoiding unnecessary re‑renders and side‑effects.

Error BoundaryLoading StatePromise
0 likes · 13 min read
Using React’s Built‑in Features to Handle Loading and Error States with Promises
Rare Earth Juejin Tech Community
Rare Earth Juejin Tech Community
Sep 4, 2023 · Frontend Development

Controlling Concurrent Requests in JavaScript with Promise.all, Promise.race, and async/await

This article explains how to manage multiple asynchronous HTTP requests in modern web development by using Promise.all, Promise.race, async/await, manual counters, and third‑party libraries, providing complete code examples and best‑practice recommendations for limiting concurrency and improving application performance.

Async/AwaitConcurrencyJavaScript
0 likes · 8 min read
Controlling Concurrent Requests in JavaScript with Promise.all, Promise.race, and async/await
Rare Earth Juejin Tech Community
Rare Earth Juejin Tech Community
Aug 25, 2023 · Frontend Development

Implementing createPromise and createRetryPromise Utility Functions in JavaScript

This article explains the design and step‑by‑step implementation of two JavaScript utility functions—createPromise for exposing a Promise’s resolve/reject handlers and createRetryPromise for adding configurable retry logic—complete with TypeScript typings, detailed code walkthroughs, and a practical network‑request example.

AsyncJavaScriptPromise
0 likes · 11 min read
Implementing createPromise and createRetryPromise Utility Functions in JavaScript
Rare Earth Juejin Tech Community
Rare Earth Juejin Tech Community
Aug 2, 2023 · Frontend Development

Implementing a Custom Promise in JavaScript: A Comprehensive Guide

This article provides a step‑by‑step tutorial on building a custom Promise implementation in JavaScript, covering basic functionality, handling of asynchronous logic, chaining, thenable objects, microtasks, error handling, static methods like resolve, reject, all, race, allSettled, any, and additional features such as catch and finally.

CustomImplementationPromiseasynchronous
0 likes · 32 min read
Implementing a Custom Promise in JavaScript: A Comprehensive Guide
php中文网 Courses
php中文网 Courses
May 8, 2023 · Backend Development

Concurrent Requests to Third-Party APIs in Node.js

This article explains how to use Node.js's built‑in http/https modules to call third‑party APIs and demonstrates three concurrency techniques—Promise.all, async/await with Promise.race, and EventEmitter—to perform parallel requests efficiently, including code examples for constructing requests, handling responses, and error management.

Async/AwaitConcurrencyEventEmitter
0 likes · 8 min read
Concurrent Requests to Third-Party APIs in Node.js
Sohu Tech Products
Sohu Tech Products
Mar 22, 2023 · Frontend Development

Deep Dive into async/await, Promise, and Event Loop Mechanics in JavaScript

This article explains how async functions, await expressions, and Promise objects interact with JavaScript's event loop, illustrating the differences in micro‑task scheduling through numerous code examples and detailing how return values affect the number of queued tasks.

Async/AwaitEvent LoopJavaScript
0 likes · 13 min read
Deep Dive into async/await, Promise, and Event Loop Mechanics in JavaScript
ByteFE
ByteFE
Mar 20, 2023 · Frontend Development

Understanding the Proposed React “use” Hook: Design, Usage, and Limitations

This article explains the new React "use" hook proposal, covering its background, how to integrate it with Suspense, minimal examples, promise caching, control‑flow usage, design motivations, implementation details, limitations, and the surrounding community debate.

HooksJavaScriptPromise
0 likes · 12 min read
Understanding the Proposed React “use” Hook: Design, Usage, and Limitations
Bilibili Tech
Bilibili Tech
Jan 3, 2023 · Frontend Development

Understanding JavaScript Promises: Concepts, Implementation, and Practical Use Cases

The article traces JavaScript promises from their 1988 origins and early libraries through the Promise/A+ spec and ES6 implementation, explains core rules, demonstrates practical rewrites using chaining, async/await, error handling, cancellation patterns, and parallel execution with Promise.all, offering guidance for robust asynchronous code.

Async/AwaitFront-endJavaScript
0 likes · 17 min read
Understanding JavaScript Promises: Concepts, Implementation, and Practical Use Cases
ByteFE
ByteFE
Dec 12, 2022 · Frontend Development

Understanding JavaScript Asynchronous Mechanisms and the Event Loop

This article explains why JavaScript, despite being single‑threaded, needs asynchronous mechanisms such as the event loop, details macro‑ and micro‑tasks, compares browser and Node.js implementations, and demonstrates common pitfalls and best practices using callbacks, Promise, generator, and async/await patterns.

AsyncEvent LoopJavaScript
0 likes · 16 min read
Understanding JavaScript Asynchronous Mechanisms and the Event Loop