-
Notifications
You must be signed in to change notification settings - Fork 87
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
base: main
Are you sure you want to change the base?
Conversation
var publisher: AnyPublisher<Element, Swift.Never> { | ||
RxInfalliblePublisher(upstream: self).eraseToAnyPublisher() | ||
} |
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.
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?
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. 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
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 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.
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, I was referring to RxInfallibleSubscription which does already exist but is not used anywhere.
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.
Anyway, I've changed it to use assertNoFailure as you suggested
Simplify the code
Adresses issue #34