Search code examples
design-patternsredux

Redux and Design Patterns


I've been using Redux for several months and have a good feel for the unidirectional data flow. However, I'm not trained in OOP and Design Patterns. After listening to a talk by Ralph E Johnson my first reaction was that the Observable Pattern is very similar to Redux/Flux flow, is that correct? Where does that analogy break down?

He talks about the Interfaces required to implement Observable Patterns - is this the sort of thinking that the authors of Redux/Flux architecture have in mind when designing these libraries/architectures?


Solution

  • Yes, the Redux store itself is a simple observable/pub-sub implementation, with a single "change/updated" event emitter. The use of actions and reducers has some similarities to CQRS and event sourcing as well. See https://redux.js.org/introduction/motivation and https://redux.js.org/introduction/prior-art .