DEV Community

Discussion on: The Publisher/Subscriber Pattern in JavaScript - Simplified

Collapse
 
jadczakd profile image
jadczakd • Edited

Just one comment, you should use filter in your example as the way you're using index will not work. If you're removing the earlier subscription before the later one the latter index is already undefined and can't be removed that way. @jsmanifest