From 1cc5552d91f46fd34be3d76c3dc995ca4c492b9c Mon Sep 17 00:00:00 2001 From: Tyler Cloutier Date: Mon, 21 Nov 2016 01:30:43 -0800 Subject: [PATCH] Added flatMap for Source too. --- Sources/Source.swift | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Sources/Source.swift b/Sources/Source.swift index 6577ae5..8ac5bd7 100644 --- a/Sources/Source.swift +++ b/Sources/Source.swift @@ -262,6 +262,11 @@ public extension SourceType { public func flatMap(_ transform: @escaping (Value) -> U?) -> Source { return lift { $0.flatMap(transform) } } - + + public func flatMap(_ transform: @escaping (Value) -> Source) -> Source { + return lift { $0.map(transform).joined() } + } + + }