Navigation Example
eliekarouz opened this issue · 2 comments
Hi,
I've recently started to introduce the RxFeedback into my app. It's very simple, powerful and promotes very structured code. I am struggling a little bit with the navigation maybe because I am new to the concept. Is there a way to provide examples around this topic.
1- How to share a state across a couple of view controllers:
Although it's not that good but to keep things simple I inherited a navigation controller. The navigation controller has the system operator. I tried to create a feedback loop (react). It will query the state to see if a new navigation should be performed and the effect would be to create the next view controller and bind it to the main state. Unfortunately, I wasn't able to implement the last part.
2- How to create outer loops:
I am trying to do what you stated in the 20 mins pitch. I think that this similar to the first one.
3- For the navigation I tried to do things like button.rx.tap.withLatestFrom(state)
. So that I can pass a part of the state to another controller. Is this bad?
Thanks
Hi @eliekarouz ,
button.rx.tap.withLatestFrom(state)
works, sure, but in that way if you are logging events you won't log that button tap.
Another way is for your state to contain part that says navigateToXXX
. You observe that part of state (navigateToXXX) and if navigate is true, then you navigate where you want.
Thanks @kzaher.