-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
EC #7694
base: main
Are you sure you want to change the base?
EC #7694
Conversation
@hellohuanlin any chance you can look at the generated swift code and let me know if there is a more idiomatic way to do this? |
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.
Only reviewed swift syntax. But I may need a better understanding for a more in-depth review (is there a design doc of what this is for?)
packages/pigeon/platform_tests/test_plugin/ios/Classes/CoreTests.gen.swift
Outdated
Show resolved
Hide resolved
func onCancel(withArguments arguments: Any?) {} | ||
} | ||
|
||
class PigeonEventSink<T> { |
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.
It looks like this is just a 1-line wrapper? Can we just inline the calls?
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.
What do you mean by "inline" specifically?
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.
Can we directly use the wrapped type rather than using this wrapper?
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.
no, the purpose of this wrapper is to enforce type safety on the return value
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.
By type safety you mean the generic type T
in the success(_ value:)
call?
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.
yeah, so I see what you mean, the error method isn't needed. I'm not sure if this is it's final form, but if it is, I'll remove it.
packages/pigeon/platform_tests/test_plugin/ios/Classes/TestPlugin.swift
Outdated
Show resolved
Hide resolved
packages/pigeon/platform_tests/test_plugin/ios/Classes/TestPlugin.swift
Outdated
Show resolved
Hide resolved
packages/pigeon/platform_tests/test_plugin/ios/Classes/TestPlugin.swift
Outdated
Show resolved
Hide resolved
Syntax is all I was really hoping for :) Thank you. Just wanted to make sure there wasn't a more idiomatic way to handle the class structure and inheritance and such. |
No description provided.