The Right Way to Create Observable Subjects in JavaScript
A best practice on how to define your Subjects in JavaScript objects.
While working on your cool JavaScript project, you might need to implement a service which manages a stream of data. In this case, the first thing pops up into your mind is using Observables or Subjects.
You can do this using libraries like Rxjs or you can even implement it yourself as I showed you before on my article How to Use Observables with Vanilla JavaScript. No frameworks used, just pure vanilla JavaScript.
Either ways, at the end you would need to wrap a Subject inside your service object. However, there are more than one way to do it.
In this article, we would get introduced to a Best Practice on how to implement this.
🗣📢 You can read the rest of the article on The Right Way to Create Observable Subjects in JavaScript.
More From the Author
and even more...