-
Notifications
You must be signed in to change notification settings - Fork 112
Open
Description
I was wondering if we could add a new function in the SignalProtocol+Sequence.swift file that would allow to filter the elements of a sequence of a signal.
For example :
extension SignalProtocol where Element: Sequence {
/// Filter inner sequence.
public func filterElement(_ isIncluded: @escaping (Element.Iterator.Element) -> Bool) -> Signal<Element, Error> {
return self.map { $0.filter(isIncluded) as! Self.Element }
}
}
... or something along those lines.
Since we already have mapElement
, it seems that filterElement
is only appropriate (?).
Metadata
Metadata
Assignees
Labels
No labels