-
Notifications
You must be signed in to change notification settings - Fork 856
Adds SocketIOClient#once(event, callback) #183
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
Conversation
When the specified event is emitted, the handler deregisters itself.
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 shouldn't need type declarations here.
let handler = SocketEventHandler(event: event) {data, ack inShould be fine
|
All fixed! 👍 |
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.
Why is this needed?
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't compare structs. I looked at other Swift-based event dispatchers that support removing specific handlers and they use id's like this to compare them.
Adds SocketIOClient#once(event, callback)
|
It would be great to cover this functions with tests... In my opinion every new functions should be tested, before the PR is merged |
When the specified event is emitted, the handler deregisters itself.