.await has wrong type?
See original GitHub issueSummary
I think the TypeScript type for Most.await
is problematic. Consider this code:
return Most
.periodic(queueSettings.WaitTimeSeconds / 1000)
.map(() => pull(settings.queue, queueSettings))
.await() // should be awaitPromises but TypeScript definition doesn't accept that yet...
.concatMap((data: AWS.SQS.ReceiveMessageResult) =>
Most.from(data.messages.map(process)),
)
.multicast()
Expected result
It should return a Stream<Change>
.
Actual Result
It instead returns a Stream<{}>
. This is because of await
which has a return value of Stream<{}>
.
Versions
- most.js: <version>
^1.4.0
I will try to come back with a PR or failing that a simplified repro.
Issue Analytics
- State:
- Created 6 years ago
- Comments:13 (7 by maintainers)
Top Results From Across the Web
Task has a wrong return type - Stack Overflow
No Task in your Button Click event. Just async . It's an event handler. Returns nothing. – Jimi. Aug 26, 2018 at 9:07....
Read more >Wrong type after await · Issue #44314 · microsoft/TypeScript
Intellisense (hovering over) on this.myProp (last line of the load-method) shows type "number". Expected behavior. Intellisense on this.
Read more >C# Async void return type of event handler got warning/error
I understand the async should not use void as return type unless it is an event handler. But I have code snippet above,...
Read more >async/await is the wrong abstraction - LogRocket Blog
Async/Await is literally syntatic sugar over generators which is the correct abstraction. This article is like complaining that array.push is ...
Read more >Asynchronous programming: futures, async, await | Dart
This codelab teaches you how to write asynchronous code using futures and the async and await keywords. Using embedded DartPad editors, you can...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Maybe this can be helpful
@jasonkuhrt this just landed in most 1.6.1. Thanks again for raising the issue, and thanks @gcanti for the solution.