Skip to content
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

Open
wants to merge 2 commits into
base: devel
Choose a base branch
from
Open

Add promise support #266

wants to merge 2 commits into from

Conversation

Lepozepo
Copy link

@Lepozepo Lepozepo commented Mar 8, 2017

Fixes #208

@Lepozepo
Copy link
Author

Lepozepo commented Mar 8, 2017

Not the prettiest way to do it but good enough I think, using it in production as is

@alexgzhou
Copy link

alexgzhou commented Jun 2, 2017

Need this feature!!!

@Lepozepo
Copy link
Author

Lepozepo commented Jun 2, 2017

@alexgzhou the package is published to atmosphere as lepozepo:restivus in the meantime ^_^

@GwendalBroudin
Copy link

Why is it taking so long to accept it ? The fix doesn't seems that ugly and it is a quite important feature =).

@formspoint
Copy link

Yeah, this repo seems abandoned too. 6 PRs up in the air so far.

@GwendalBroudin
Copy link

They should grant write access to more people if they can't maintain the project anymore =/

@aadamsx
Copy link

aadamsx commented Jul 4, 2017

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

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.

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?!!

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.

Copy link

@ugokoli ugokoli left a 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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants