remove async/await
See original GitHub issueIssue Description
I have a class definition that looks like
class X {
constructor() {
this._analyzer = null;
}
async init(arg) {
await something()
}
}
and I need to strip async
and await
from/in method init
. This is a source that is not under my control, but which I know will work without async in my own context, where I need it to be sync. How would I do this with putout?
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:15 (8 by maintainers)
Top Results From Across the Web
Unnecessary async/await when await is last? - Stack Overflow
When thread reaches await workTask; it split the method to 2 sections . so after SimulateWork is finished - the continuation of the...
Read more >Removing async void - John Thiriet
Async propagation Any code that calls PrepareCoffeeAsync will then need to await it's completion. Repeat the same process enough and you will ...
Read more >How to escape async/await hell - freeCodeCamp
This means that await is not required for executing the function. The async function will return a promise, which you can use later....
Read more >Avoiding simple mistakes in async await - Anthony Steele
Let the async flow. Use await not .Result to get the result of a task. Avoid becoming synchronous again wherever possible. Avoid Task.Run ......
Read more >Asynchronous Programming - EF Core - Microsoft Learn
Querying and saving data asynchronously with Entity Framework Core. ... This is typically done by using the await keyword on each async ......
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 Free
Top 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
Man, I’m dump. There’s no need for me to strip citeproc – the dead code elimination of the bundler I use does a better job than I did, automatically.
Superb – the promise unwrapper does the job and
emove-nested-blocks
does the rest.I’m installing the node package, and that only has the generated file. I’ll see if I can put together a replacer that strips them.