-
Notifications
You must be signed in to change notification settings - Fork 432
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 merge(with:) operator #600
Merged
+205
−28
Merged
Changes from 2 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
657810a
Add merge(with:) operator
ra1028 ee123bb
Update CHANGELOG
ra1028 22bbee9
Add tests for Signal.merge(with:)
ra1028 ae40e6d
Add tests for SignalProducer.merge(with:)
ra1028 2a48252
Refactor tests for Signal.merge() and SignalProducer.merge()
ra1028 d9935fd
Revert docs for Signal.merge() and SignalProducer.merge()
ra1028 6e4cbfc
Merge master
ra1028 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -788,6 +788,17 @@ extension Signal { | |
public func combineLatest<U>(with other: Signal<U, Error>) -> Signal<(Value, U), Error> { | ||
return Signal.combineLatest(self, other) | ||
} | ||
|
||
/// Merge the given signal into a single `Signal` that will emit all | ||
/// values from both of them, and complete when all of them have completed. | ||
/// | ||
/// - parameters: | ||
/// - other: A signal to merge `self`'s value with. | ||
/// | ||
/// - returns: A signal that sends all values of `self` and given signal. | ||
public func merge(with other: Signal<Value, Error>) -> Signal<Value, Error> { | ||
return Signal.merge(self, other) | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we still ought to have a test for this (and the |
||
|
||
/// Delay `value` and `completed` events by the given interval, forwarding | ||
/// them on the given scheduler. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Normally I wouldn't mind this, but Xcode does not make it easy to find this documentation, so I'd keep it duplicated.
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.
hmm, I was according to
zip
,combineLatest
operator, though should revert?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.
We should duplicate it in those too IMO (at least until SourceKit & CMD+Click actually works consistently in Xcode). For now can you keep these how they were?
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.
gotcha, will revert them:+1:
Write the doc for
zip
andcombineLatest
, will too much lines.I think there are pros and cons, so not to write now.