File tree Expand file tree Collapse file tree 5 files changed +10
-10
lines changed
Example/RxController/Flow Expand file tree Collapse file tree 5 files changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ class AppFlow: Flow {
3535 switch appStep {
3636 case . main:
3737 let mainFlow = MainFlow ( )
38- Flows . whenReady ( flow1 : mainFlow ) { [ unowned self] in
38+ Flows . use ( mainFlow , when : . ready ) { [ unowned self] in
3939 self . navigationController. viewControllers = [ $0]
4040 }
4141 return . flow( mainFlow, with: MainStep . start)
Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ class FriendsFlow: Flow {
3838 return . viewController( friendsViewController)
3939 case . profile( let name) :
4040 let profileFlow = ProfileFlow ( name: name)
41- Flows . whenReady ( flow1 : profileFlow ) {
41+ Flows . use ( profileFlow , when : . ready ) {
4242 self . navigationController? . pushViewController ( $0, animated: true )
4343 }
4444 return . flow( profileFlow, with: ProfileStep . start)
Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ class MainFlow: Flow {
3333 case . start:
3434 let childFlow = ChildFlow ( )
3535 let profileFlow = ProfileFlow ( )
36- Flows . whenReady ( flow1 : childFlow, flow2 : profileFlow ) {
36+ Flows . use ( childFlow, profileFlow , when : . ready ) {
3737 self . mainViewController. viewControllers = [ $0, $1]
3838 }
3939 return . multiple( flowContributors: [
Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ class ProfileFlow: Flow {
3838 return . viewController( profileViewController)
3939 case . friends( let name) :
4040 let friendsFlow = FriendsFlow ( name: name)
41- Flows . whenReady ( flow1 : friendsFlow ) {
41+ Flows . use ( friendsFlow , when : . ready ) {
4242 self . navigationController? . pushViewController ( $0, animated: true )
4343 }
4444 return . flow( friendsFlow, with: FriendsStep . start)
Original file line number Diff line number Diff line change @@ -59,15 +59,15 @@ public struct RxControllerEvent {
5959extension ObservableType where Element == RxControllerEvent {
6060
6161 public func value< T> ( of identifier: RxControllerEvent . Identifier , type: T . Type = T . self) -> Observable < T ? > {
62- return observe ( on: MainScheduler . asyncInstance) . filter {
63- $0. identifier. id == identifier. id
64- } . map {
65- $0. value as? T
66- }
62+ return observe ( on: MainScheduler . asyncInstance)
63+ . filter { $0. identifier. id == identifier. id }
64+ . map { $0. value as? T }
6765 }
6866
6967 public func unwrappedValue< T> ( of identifier: RxControllerEvent . Identifier , type: T . Type = T . self) -> Observable < T > {
70- return value ( of: identifier) . filter { $0 != nil } . map { $0! }
68+ return value ( of: identifier)
69+ . filter { $0 != nil }
70+ . map { $0! }
7171 }
7272
7373}
You can’t perform that action at this time.
0 commit comments