Promise returning `unit` through c'tor is dangerous
See original GitHub issue
What it looks like in Logary above. After careful inspection, we’re returning Promise.Now.withValue () but this is how people who are not me or you think by default.
So I think we should upgrade the new API with the c’tor of Promise to a bug – a bug in how you’re intended to use the API versus what people actually do. Also see https://github.com/Hopac/Hopac/commit/5a60797462deff83135fa0ee02403671045774ff#commitcomment-18537736
Issue Analytics
- State:
- Created 7 years ago
- Comments:14 (14 by maintainers)
Top Results From Across the Web
Is it bad practice to have a constructor function return ...
Yes, it is a bad practise. A constructor should return an instance of its class, nothing else. It would mess up the new...
Read more >Testing Promise Side Effects with Async/Await
This test will actually fail because promise callbacks are asynchronous, so any callbacks sitting in the queue will run after the last statement...
Read more >The Proper Way to Write Async Constructors in JavaScript
As a matter of fact, yes! A Promise instance is indeed a non-primitive value after all. Therefore, the constructor will return that instead...
Read more >Promise() constructor - JavaScript - MDN Web Docs
The Promise() constructor creates Promise objects. It is primarily used to wrap callback-based APIs that do not already support promises.
Read more >Programming patterns | ArcGIS Maps SDK for JavaScript 4.27
When the task executes, the promise allows other processes to run simultaneously while it waits for a future value to be returned. This...
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

Well, even though it hurts like hell every time you make a breaking change to Hopac, if you do it now before v1 then we can live happily ever after v1.
Isn’t
Job.resultas much a value asPromise.value?