-
Notifications
You must be signed in to change notification settings - Fork 116
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
Add promise support #266
base: devel
Are you sure you want to change the base?
Add promise support #266
Conversation
Not the prettiest way to do it but good enough I think, using it in production as is |
Need this feature!!! |
@alexgzhou the package is published to atmosphere as |
Why is it taking so long to accept it ? The fix doesn't seems that ugly and it is a quite important feature =). |
Yeah, this repo seems abandoned too. 6 PRs up in the air so far. |
They should grant write access to more people if they can't maintain the project anymore =/ |
I'm trying to "rebuild" this project over here: https://github.com/aadamsx/restfine. No more coffee script, refactored to ES6, and now trying to convert the project to npm. Any and all help is appriciated. |
@@ -57,26 +74,15 @@ class share.Route | |||
responseData = null | |||
try | |||
responseData = self._callEndpoint endpointContext, endpoint | |||
if responseData instanceof Promise |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can use Promise.resolve
to handle with the same syntax the case where the result is a Promise
and when it isn't. But of course it works the way you did it ;)
Promise.resolve(responseData).then (result) ->
respond result, {responseInitiated, res}
I don't really understand what the try catch
block is for though, so maybe I'm wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this package about to publish a new version?!!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use lepozepo:restivus
, this package doesn't seem to be maintained.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but this is 2021 and it is still open... wow!
Fixes #208