
[video] Unidirectional Data Flow in Swift - Ben-G
https://realm.io/news/benji-encz-unidirectional-data-flow-swift/
======
frankus
Have you considered using NSCoding to persist state?

~~~
Ben-G
Yes! Though it would require the state to be an Objective-C class instead of a
struct. We're currently trying not to rely on Obj-C at all.

------
ediasnz
How would you pass parameters to the next view controller on the flow?

~~~
ctietze
I think you wouldn't; instead, you change the state twice: once the "model"
state, once the navigation state.

The first will incorporate the changes of the current view controller and make
it accessible to whoever is interested -- and then the next view controller
will show the current "model" state which in fact includes everything that was
changed already.

~~~
Ben-G
That is correct! However, we are also working on making it possible to pass
data as part of the routing process (that will be implemented in
ReSwiftRouter) as that is necessary for recursive routes.

~~~
ediasnz
I think passing data will be required in some cases in order to solve the
dependencies of the next view controller on the flow. Otherwise the store will
have to solve these dependencies of all View Controllers which I think it's
not ideal.

