-
Notifications
You must be signed in to change notification settings - Fork 42
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 EmptyDisposable #209
base: master
Are you sure you want to change the base?
Add EmptyDisposable #209
Conversation
219fab2
to
0bf84b3
Compare
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.
overall looks like a good convenience to add
} | ||
|
||
public extension Disposable where Self == EmptyDisposable { | ||
static var empty: EmptyDisposable { EmptyDisposable() } |
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 the disposable will be most of the times used through this getter, I would suggest to add documentation to it, such as:
static var empty: EmptyDisposable { EmptyDisposable() } | |
/// Gets the disposable that does nothing when disposed. | |
static var empty: EmptyDisposable { EmptyDisposable() } |
} | ||
|
||
public extension Disposable where Self == EmptyDisposable { | ||
static var empty: EmptyDisposable { EmptyDisposable() } |
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 we don't need the concrete type outside, could you return just Disposable
? (on iOS 13+ even some Disposable
, but I think that the target here is lower)
0bf84b3
to
149d395
Compare
No description provided.