Posts

Showing posts from November, 2019

Using an Singleton with Observer Pattern to manage State?

A general question, I created a Singleton which will use an Observer Pattern where the Singleton becomes the Subject. And every Web Component in my app could become an Observer. What is Pro/Con here? The main issue I found is that with Pub/Sub the Subject & Observer are loose coupled and work over messages. But is it so bad to use the Observer pattern in a Single Page app in a way everything should be together no? I wonder what you people think of this? And no I don't want to use Redux or NGRX or any other library. Looking forward to your feedback or comments. -- Als je vragen hebt, aarzel dan niet om Contact met ons op te nemen. We helpen je graag verder. We kijken er naar uit om je te helpen bij de groei van je bedrijf. © 2023 WebWizArt.be BV. 🇧🇪 🏳️ 🌈 🏴 ☠️ All rights reserved.