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

Refactor code and fix support spring 2.1.x #65

Merged
merged 1 commit into from
Aug 26, 2019

Conversation

baonguyena1
Copy link

Refactor code for the same logic when connecting with the socket
Fix connection headers for supporting spring 2.1.x

Refactor code for the same logic when connect with the socket
@@ -90,16 +90,12 @@ public class StompClientLib: NSObject, SRWebSocketDelegate {
}
}

public func openSocketWithURLRequest(request: NSURLRequest, delegate: StompClientLibDelegate) {
Copy link
Owner

Choose a reason for hiding this comment

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

Actually without header still would be useful. It should stay with overload methods.

Copy link
Author

Choose a reason for hiding this comment

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

Yup, you right, but I keep the same function with default connectionHeaders properties with null value with one function for the same logic, don't need override. With default connectionHeaders value in function define, you can use with without header or not, like

Without headers with defaults value is null:
socketClient.openSocketWithURLRequest(request: request, delegate: delegate)

With headers:
socketClient.openSocketWithURLRequest(request: request, delegate: delegate, connectionHeaders: headers)

Copy link
Owner

Choose a reason for hiding this comment

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

Awesome answer :) Have you tested it? Does it work with your way? If it is, I will merge it and publish a new version 🎉

Copy link
Author

Choose a reason for hiding this comment

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

Yup, I have tested it with my project.

Copy link
Owner

Choose a reason for hiding this comment

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

Nice job :) I'm gonna test it and release it soon

@WrathChaos
Copy link
Owner

WrathChaos commented Aug 26, 2019

@baonguyena1 Thank you so much for contribution :) I merged your PR and published a new release.

🎉Release 1.3.7 🎉

Screenshot 2019-08-26 at 14 45 51

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

Successfully merging this pull request may close these issues.

2 participants