Skip to content

Commit

Permalink
Added flatMap for Source too.
Browse files Browse the repository at this point in the history
  • Loading branch information
cloutiertyler committed Nov 21, 2016
1 parent 1866fcb commit 1cc5552
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Sources/Source.swift
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,11 @@ public extension SourceType {
public func flatMap<U>(_ transform: @escaping (Value) -> U?) -> Source<U, Error> {
return lift { $0.flatMap(transform) }
}


public func flatMap<U>(_ transform: @escaping (Value) -> Source<U, Error>) -> Source<U, Error> {
return lift { $0.map(transform).joined() }
}


}

0 comments on commit 1cc5552

Please sign in to comment.