While working with any language, we tend to use several reusable design solutions to commonly occurring problems. In JavaScript, too, we have a mix...
For further actions, you may consider blocking this person and/or reporting abuse
Maybe I'm reading this wrong, but I think there's a bug in your unsubscribe function. If the predicate in the filter is true, then the item won't be filtered. I think you want !==.
Thank you for pointing this out...it drove me crazy for an hour at least :)
You are correct, thanks for pointing it out. I have updated it in the post.
This is a really great article on the Observer pattern. To the point and very visual as well.
The bug mentioned by dev.to/shiznit013 "( .filter( !== instead of === )" was fixed in the first example but it still remains in the final example in Code-pen. This really drove me crazy for a few minutes till I read Shiznit013's comment.
But, other than that little bug, this is a beautiful piece. Thanks so much, for taking the time and effort to write this.
You might want to check out my servable observable :-)
servable.serveside.dev
Created it a couple years ago while reading the rx docs
It does need some polish
It does look really good 🙂
Thanks :-)
No word about RXJS which impléments this pattern for a long time…
Angular uses rxjs in his core :)
I would have loved to mention it but I haven't used RxJS or Angular.
I will definitely research and update the post in near future
Great content, I find it very 7
Thanks a lot. It feels good to hear this 😃