File tree Expand file tree Collapse file tree 1 file changed +15
-14
lines changed
Sources/ScreenDataNavigation Expand file tree Collapse file tree 1 file changed +15
-14
lines changed Original file line number Diff line number Diff line change @@ -149,20 +149,21 @@ public protocol ScreenLoading {
149149 func load( withProvider provider: ScreenProviding ) -> AnyPublisher < [ SomeScreen ] , Error >
150150}
151151
152- //// MARK: ScreenLoading Basic Implementation [WIP]
153- //@available(iOS 13.0, OSX 10.15, *)
154- //extension SomeScreen: ScreenLoading {
155- //
156- // public func load(withProvider provider: ScreenProviding) -> AnyPublisher<[SomeScreen], Error> {
157- // Publishers.MergeMany(
158- // destinations
159- // .filter { $0.type == .screen }
160- // .map { destination in
161- // provider.screen(forID: destination.toID)
162- // }
163- // )
164- // }
165- //}
152+ // MARK: ScreenLoading Basic Implementation
153+ @available ( iOS 13 . 0 , OSX 10 . 15 , * )
154+ extension SomeScreen : ScreenLoading {
155+
156+ public func load( withProvider provider: ScreenProviding ) -> AnyPublisher < [ SomeScreen ] , Error > {
157+ Publishers . MergeMany (
158+ destinations. filter { $0. type == . screen }
159+ . map { destination in
160+ provider. screen ( forID: destination. toID)
161+ }
162+ )
163+ . collect ( )
164+ . eraseToAnyPublisher ( )
165+ }
166+ }
166167
167168public extension SomeView {
168169 var destinations : [ Destination ] {
You can’t perform that action at this time.
0 commit comments