mardi 12 février 2019

How to design and implement websocket filtering per page

I want to manage my socket subscription per page in my angular 6 application.

Currently, in our application, we're subscribing to all sockets during the app initialization, I'd like to change it so each page will subscribe to its relevant sockets and unsubscribe from all others.

But since I've got many pages and many sockets I'd like to think there's a better way to manage it instead of doing it separately for each one of the pages in its ngOnInit.

Do you have any recommendation, or know a pattern for this type of usage I seek?

Aucun commentaire:

Enregistrer un commentaire