ThreadSky
About ThreadSky
Log In
orisomething.bsky.social
•
11 days ago
But rejections have no effect over the type today. The rejection value stays any/unknown
Comments
Log in
with your Bluesky account to leave a comment
[–]
dr-axel.de
•
11 days ago
True! But the callback result should be: void | Promise
0
1
reply
[–]
orisomething.bsky.social
•
11 days ago
But `void` allows you to pass any value. `void | Promise
` is the same as `void`
0
1
reply
[–]
dr-axel.de
•
11 days ago
Interesting point.
On one hand:
Promise.resolve().finally(() => Promise.reject()); // OK
On the other hand:
function f(): void {
return Promise.reject();
// Type 'Promise
' is not assignable to type 'void'.
}
Either way, I’d still find `void | Promise
` more descriptive.
0
reply
Posting Rules
Be respectful to others
No spam or self-promotion
Stay on topic
Follow Bluesky's terms of service
×
Reply
Post Reply
Comments
On one hand:
Promise.resolve().finally(() => Promise.reject()); // OK
On the other hand:
function f(): void {
return Promise.reject();
// Type 'Promise
}
Either way, I’d still find `void | Promise