TypeScriptAsync, Promises & Error Handling Types

78 items

1

Typing .then() and .catch() Handlers

Flashcard
2

Typing for-await-of Loop Variables

Flashcard
3

Why Promise Rejections Aren't Typed

Slides / Video
4

Void-Returning Promises and Fire-and-Forget

Slides / Video
5

Typing Promise Executor Callbacks

Slides / Video
6

Result Union Types for Success and Failure

Slides / Video
7

Custom Error Classes and Typing Them

Slides / Video
8

The useUnknownInCatchVariables Flag

Slides / Video
9

Narrowing unknown Errors in catch

Slides / Video
10

Catch Clause Errors Are unknown

Slides / Video
11

Typing race, allSettled, and any

Slides / Video
12

Typing Promise.all Tuple Results

Slides / Video
13

Typing await and Unwrapped Values

Slides / Video
14

The Promise<T> Type Parameter

Slides / Video
15

Async Function Return Types

Slides / Video
16

Custom Error Class Typing

Code Quiz
17

Narrowing an unknown Error

Code Quiz
18

catch Variable Is unknown

Code Quiz
19

Chained then Return Value

Code Quiz
20

instanceof Error Narrowing

Code Quiz
21

Reading allSettled Results

Code Quiz
22

Typing the Executor Callback

Code Quiz
23

Typing catch Handler Parameter

Code Quiz
24

Wrong Resolved Value Type in Promise

Code Quiz
25

async Function Returning void

Code Quiz
26

Floating Promise Not Awaited

Code Quiz
27

Always-Throwing Function Return Type

Code Quiz
28

Typing an async Generator

Code Quiz
29

Discriminated Result Type

Code Quiz
30

Typing an async Arrow Function

Code Quiz
31

Iterating an AsyncIterable

Code Quiz
32

Promise Type Has One Parameter

Code Quiz
33

Typing Promise.resolve and reject

Code Quiz
34

Async Function Return Type

Code Quiz
35

Awaiting a Non-Promise Value

Code Quiz
36

Typing a Promise with Promise<T>

Code Quiz
37

Promise.race Return Type

Code Quiz
38

Promise.all Result Tuple Types

Code Quiz
39

await Outside an async Function

Code Quiz
40

Awaiting Unwraps the Value Type

Code Quiz
41

Typing async Function Return Values

Quiz
42

never Return Type for Throwing Functions

Quiz
43

Typing Rejected Promise Values

Quiz
44

void vs Promise<void> in Async Contexts

Quiz
45

useUnknownInCatchVariables Flag

Quiz
46

Typing Promise.allSettled Result Shape

Quiz
47

Floating Promise Concerns

Quiz
48

Typing Promise.all Result Tuples

Quiz
49

Typing then/catch Callback Chains

Quiz
50

Typing Promise.race and Promise.any

Quiz
51

await Expression Result Types

Quiz
52

catch Clause Variable Typing

Quiz
53

Promise Executor and resolve/reject Typing

Quiz
54

Narrowing Errors in catch Blocks

Quiz
55

Promise<T> Type Annotation

Quiz
56

Typing Callback-to-Promise Wrappers

Quiz
57

Custom Error Class Typing

Quiz
58

Result / Either Pattern for Typed Errors

Quiz
59

for await...of Element Typing

Quiz
60

instanceof Error Narrowing in catch

Quiz
61

Async Generators and AsyncIterable Types

Quiz
62

Typing Promise Resolution Values

Flashcard
63

Typing Promise.all Results as a Tuple

Flashcard
64

Awaiting a Promise and the Resulting Type

Flashcard
65

Custom Error Class Typing

Flashcard
66

Typing Promise.race and Promise.allSettled

Flashcard
67

PromiseSettledResult Types

Flashcard
68

Result/Either Pattern for Error Handling

Flashcard
69

Errors Are Typed as unknown in catch

Flashcard
70

Typing the Promise Executor Callbacks

Flashcard
71

Explicitly Annotating async Return Types

Flashcard
72

The Promise<T> Type

Flashcard
73

Chaining Promises and Return Type Flow

Flashcard
74

async Function Return Type Inference

Flashcard
75

useUnknownInCatchVariables Flag

Flashcard
76

Narrowing Caught Errors with instanceof

Flashcard
77

The never Type in Throwing Functions

Flashcard
78

Void vs Undefined Return in Async Callbacks

Flashcard
FlashcardIntermediate

Typing Promise.all Results as a Tuple

Promise.all preserves each promise's type as a positional tuple of resolved values.

Question

What type does `await Promise.all([Promise<number>, Promise<string>])` produce?

Click to reveal answer