-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature - Deferreds without parameters #43
Comments
Sorry for the delay. I'm keeping this in the back of my mind, but I don't have a pressing need for the proper feature since a workaround is so easy. |
While it is true that the workaround is easy, it does clutter up my APIs with misleading information. |
I'll keep this open, but for what it's worth this seems pretty unlikely that I'll get it working properly. Firstly, some haxe targets have a problem with a Promise type, as seen in #20. If this issue was about functionality, I'd think harder about a workaround. But, since it's about elegance, ease, and clarity, I'm seeing arguments both ways. |
TBH I use void promises all the time. Very useful if you are only interested in the success or failure of an operation. My quick solution was to just define a dumy type to represent a void promise:
That way users of the promise will understand the return value is garbage. |
There are a few cases where it'd be nice to have a Deferred that had no payload type. In that case,
.Then
would takeVoid->Void
.The fact that it resolved or failed is all the information that is needed in some cases.
(failing would still carry the error though.)
The text was updated successfully, but these errors were encountered: