btford / angular-socket-io

Socket.IO component for AngularJS
1.51k stars 233 forks source link

connect to socket for specific user #133

Open Cogiva opened 8 years ago

Cogiva commented 8 years ago

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

emps commented 8 years ago

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