Braunschweig Problem #1 • MVC doesn’t address many issues of modern app development • Complex UI • Networking • Navigation • View Controller as micromanagers ➔ Massive View Controllers 4
Braunschweig Problem #2 • Manage the different states • Currently active Views / View Controller • Database • Singletons • “how do I pass information between view controllers?” • Multiple copies of the state 5
Braunschweig Redux Components • State is an immutable data structure • State is stored inside of the store • Emitting actions to create a new state • Reducers perform the state changes • Observers will be view controllers 7
Braunschweig Middleware let actionLoggerMiddleware: Middleware = { dispatch, getState in return { next in return { action in print("Action: \(action)") // next middleware return next(action) } } } 23
Braunschweig Benefits • separation of concerns • decoupling of intent and implementation • clearer, declarative API • predictable and explicit state • state propagation for free 24