Skip to content

Promise-ify nreplClient.ts. #49

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

Merged
merged 1 commit into from
Jul 26, 2017
Merged

Promise-ify nreplClient.ts. #49

merged 1 commit into from
Jul 26, 2017

Conversation

mhansen
Copy link
Contributor

@mhansen mhansen commented Jul 23, 2017

Convert a few callers who had to wrap the callbacks in Promises to use the .then() Promise-transforming APIs instead.

Removed a duplicate definition of 'document' in clojureSuggest.ts which was flagged as a warning after this refactoring.

@fasfsfgs
Copy link
Contributor

Thank you very much for your work @mhansen!
That's a great and needed refactoring!
Can you check my review please?

@mhansen
Copy link
Contributor Author

mhansen commented Jul 24, 2017

Sorry, I'm new and I think I'm probably missing something - how do I check your review? I don't see any comments on the diffs here: https://github.com/avli/clojureVSCode/pull/49/files?diff=split. Is there a trick to show review comments?

@mhansen
Copy link
Contributor Author

mhansen commented Jul 24, 2017

Ah, I see what you mean: I left some comments on your pull request #50. Looks good!

@avli
Copy link
Owner

avli commented Jul 24, 2017

@fasfsfgs @mhansen Guys, could you explain me what review are you talking about. I don't see any comments...

const stacktrace = (session: string): Promise<any> => send({ op: 'stacktrace', session: session });
const stacktrace = (session: string): Promise<any> => {
return send({ op: 'stacktrace', session: session });
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any reason to chance this @mhansen?
Because they mean exactly the same.
Do you think it's easier to read or something like that?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just changed it to be consistent with the other lines in this file, where a bunch of the other send functions have the body of the function in a block on a new line.

But I don't feel strongly about this change at all. Actually, looking back on the original state, it seems like there is some consistency that I missed in the first place - that if it's an easy one-liner, it's done as a one-liner style, but if it wouldn't fit on one line, it's done on two lines. So maybe this was unnecessary :-)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's ok. =) It's up to you (and @avli). I'll trust whatever you think it's best then.
If you think the old way was better, just commit those changes back. If not, that's fine as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reverted these bits.

@fasfsfgs
Copy link
Contributor

@avli @mhansen That was my bad. I commented part of @mhansen's code but I didn't submit it. I just did now. And it's nothing serious or anything like that.
The work here is great!
I'm just curious about one particular change.

Convert a few callers who had to wrap the callbacks in Promises to use the .then() Promise-transforming APIs instead.

Removed a duplicate definition of 'document' in clojureSuggest.ts which was flagged as a warning after this refactoring.
@mhansen mhansen force-pushed the master branch 2 times, most recently from 9c864b4 to 75ac00c Compare July 26, 2017 09:51
Copy link
Contributor

@fasfsfgs fasfsfgs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work imo. Thank you @mhansen.

@avli avli merged commit b74a36d into avli:master Jul 26, 2017
@avli
Copy link
Owner

avli commented Jul 26, 2017

Great job indeed, guys. Thank you very much!

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.

3 participants