question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Promise returning `unit` through c'tor is dangerous

See original GitHub issue
screen shot 2016-08-11 at 17 19 38

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:closed
  • Created 7 years ago
  • Comments:14 (14 by maintainers)

github_iconTop GitHub Comments

1reaction
hafcommented, Aug 22, 2016

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.

1reaction
hafcommented, Aug 22, 2016

Isn’t Job.result as much a value as Promise.value?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found