Results for “promise”
Small, practical examples. Search by task or narrow things down below.
Deliver a result through a promise and future
C++: A promise sets a shared state and its future retrieves the value.
C++✓ Tested
Inspect both successful and failed promise results
JavaScript: allSettled preserves input order and reports failures without rejecting the combined promise.
JavaScript✓ Tested
Inspect both successful and failed promise results
TypeScript: allSettled preserves input order and reports failures without rejecting the combined promise.
TypeScript✓ Tested
Recover from an expected promise rejection
JavaScript: Return a fallback from catch so later handlers receive an ordinary resolved value.
JavaScript✓ Tested
Recover from an expected promise rejection
TypeScript: Return a fallback from catch so later handlers receive an ordinary resolved value.
TypeScript✓ Tested
Run cleanup after a promise settles
JavaScript: finally runs after success or failure and normally preserves the original outcome.
JavaScript✓ Tested
Run cleanup after a promise settles
TypeScript: finally runs after success or failure and normally preserves the original outcome.
TypeScript✓ Tested
Transform a resolved promise result
JavaScript: A then handler returns the value passed to the next promise in the chain.
JavaScript✓ Tested
Transform a resolved promise result
TypeScript: A then handler returns the value passed to the next promise in the chain.
TypeScript✓ Tested
Use the first fulfilled promise result
JavaScript: Promise.any ignores individual rejections until one input fulfills.
JavaScript✓ Tested
Use the first fulfilled promise result
TypeScript: Promise.any ignores individual rejections until one input fulfills.
TypeScript✓ Tested
Wait for multiple promises
Use Promise.all to collect JavaScript results in input order.
JavaScript✓ Tested