angular-socket-io icon indicating copy to clipboard operation
angular-socket-io copied to clipboard

connect to socket for specific user

Open Cogiva opened this issue 9 years ago • 1 comments

How would I use this to only update the specific user.

Currently the socket I have set up updates a collection for any updates by any user. How would I limit the updates on my view to the ones done by someone logged in with my username (i.e. mine or me on another device.)

Is there a simple way to register for certain updates?

Currently have in my Angular

socket.syncUpdates('transaction', transactions);

and in my Node Server

socket.emit('transaction:save', doc);

Thanks. Ben

Cogiva avatar Jan 02 '16 09:01 Cogiva

u can join user socket to a common room and then emit 'transaction:save' to the room and update all the sockets inside

emps avatar Jan 04 '16 18:01 emps