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

Deallocate Trigger Signal #99

Merged
merged 4 commits into from
Apr 15, 2016
Merged

Conversation

RuiAAPeres
Copy link
Member

I am adding some of the operators @NachoSoto shared here.

/// 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> {
Copy link
Contributor

Choose a reason for hiding this comment

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

Since Signals are hot, it seems like this could just be called toSignal.

Copy link
Member Author

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.

@neilpa
Copy link
Member

neilpa commented Apr 15, 2016

Thanks for adding these @RuiAAPeres (and thanks for the review @mdiep)

@neilpa neilpa merged commit 86a7b4a into RACCommunity:master Apr 15, 2016
return self
.rex_toSignal()
.map { _ in () }
.ignoreError()

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.

Copy link
Member Author

@RuiAAPeres RuiAAPeres Apr 18, 2016

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.

@NachoSoto
Copy link

Happy to see these make it to Rex :)

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.

4 participants