-
Notifications
You must be signed in to change notification settings - Fork 429
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
Conversation
/// - 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 comment
The 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 SignalProducer
variant below). Would you mind adding one?
Sources/Flatten.swift
Outdated
/// - parameters: | ||
/// - signals: A sequence of signals to merge. | ||
/// Merges the values of all the given signals, in the manner described | ||
/// by `merge(with:)`. |
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
and combineLatest
, will too much lines.
I think there are pros and cons, so not to write now.
I added tests |
Sources/Flatten.swift
Outdated
/// - parameters: | ||
/// - signals: A sequence of signals to merge. | ||
/// Merges the values of all the given signals, in the manner described | ||
/// by `merge(with:)`. |
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?
|
||
let mergedSignals = Signal.merge([signal1, signal2]) | ||
let mergedSignals = Signal.merge([signal1, signal2, signal3]) |
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.
Thanks for making this more complex now 👍
Awesome! Thanks for adding this. 🤘 |
Refer #597
Checklist