Skip to content
This repository has been archived by the owner on Sep 17, 2020. It is now read-only.

manavm1990/observer-pattern-spa

Repository files navigation

Using the Observer Pattern to render a Single Page Application (SPA)

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.

Get Started

npm run serve (after npm i, of course).