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 EmptyDisposable #209

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mjburghard
Copy link
Contributor

No description provided.

@mjburghard mjburghard force-pushed the add-EmptyDisposable branch 2 times, most recently from 219fab2 to 0bf84b3 Compare February 29, 2024 16:29
Copy link
Collaborator

@zvonicek zvonicek left a 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() }
Copy link
Collaborator

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:

Suggested change
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() }
Copy link
Collaborator

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)

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.

2 participants