-
Notifications
You must be signed in to change notification settings - Fork 31
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
Deallocate Trigger Signal #99
Conversation
/// use this method to be able to expose these inherently hot streams | ||
/// as `Signal`s. | ||
@warn_unused_result(message="Did you forget to call `observe` on the signal?") | ||
public func toSignalAssumingHot() -> Signal<AnyObject?, NSError> { |
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.
Since Signal
s are hot, it seems like this could just be called toSignal
.
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.
I kept the original comments from Nacho with a slight modification, but yes I agree with your suggestion.
Thanks for adding these @RuiAAPeres (and thanks for the review @mdiep) |
return self | ||
.rex_toSignal() | ||
.map { _ in () } | ||
.ignoreError() |
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.
Does this actually ignore errors? Notice that my operators don't actually ignore unexpected errors, they assert they won't happen.
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.
When an error event is sent, it will complete (by default replacement == .Completed
):
case .Failed:
observer.action(replacement)
Your operator is slightly more aggressive.
Happy to see these make it to Rex :) |
I am adding some of the operators @NachoSoto shared here.