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

Empty sequence #15

Merged
merged 3 commits into from
Feb 25, 2022
Merged

Empty sequence #15

merged 3 commits into from
Feb 25, 2022

Conversation

reddavis
Copy link
Owner

Adds an Empty sequence that has the option of returning immediately or never.

Empty<Int>().sink(
    receiveValue: { print($0) },
    receiveCompletion: { completion in
        switch completion {
        case .finished:
            print("Finished")
        case .failure:
            print("Failed")
        }
    }
)

// Prints:
// Finished

or

Empty<Int>(completeImmediately: false).sink(
    receiveValue: { print($0) },
    receiveCompletion: { completion in
        switch completion {
        case .finished:
            print("Finished")
        case .failure:
            print("Failed")
        }
    }
)

// Prints:
// 

# Conflicts:
#	Asynchrone.xcodeproj/project.pbxproj
# Conflicts:
#	Asynchrone.xcodeproj/project.pbxproj
#	README.md
@reddavis reddavis merged commit f4d01f4 into main Feb 25, 2022
@reddavis reddavis deleted the feature/empty branch February 25, 2022 12:19
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.

1 participant