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

Add overrides to support Infallible #35

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

daleswift
Copy link

Adresses issue #34

Comment on lines 13 to 15
var publisher: AnyPublisher<Element, Swift.Never> {
RxInfalliblePublisher(upstream: self).eraseToAnyPublisher()
}
Copy link
Member

Choose a reason for hiding this comment

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

this is great. Another option could probably just do asPublisher().assertNoFailure("Infallible should not fail") and that way you don't need another custom Publisher type. WDYT?

Copy link
Author

Choose a reason for hiding this comment

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

Yeah. Could do that too. But RxInfallibleSubscriber already exists so why not use that? Seems a cleaner solution.
Either way. If you prefer assertNoFailure I’ll update to that

Copy link
Member

Choose a reason for hiding this comment

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

you mean RxInfalliblePublisher ? it didn't exist, you just created it. I'm not keen on adding a new publisher like this because it inherently doesn't "do" anything and we erase the type anyways.

Copy link
Author

@daleswift daleswift May 20, 2022

Choose a reason for hiding this comment

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

No, I was referring to RxInfallibleSubscription which does already exist but is not used anywhere.

Copy link
Author

Choose a reason for hiding this comment

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

Anyway, I've changed it to use assertNoFailure as you suggested

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.

None yet

2 participants