I came to have a better understanding of the Observer Pattern as it applies to JS after reading this.
As a result, I created this simple app (not even any CSS! 😳) that incorporates ES6 Proxies. The motivation for this is to really limit how state itself can be modified. In this way, components never directly touch state
.
This example also attempts to make state, more modular. Albeit this app is simple enough to only have a single piece of state
that gets updated. However, this pattern could certainly be applied for more complex apps, conceivably.
npm run serve
(after npm i
, of course).