(private) new Emit(id) → {EmitInterface}
Emit events with content to specific socket connection
Parameters:
Name | Type | Description |
---|---|---|
id |
string | The id of the socket connection |
Returns:
Takes an event and a message object and sends to the socket connection
- Type
- EmitInterface
Type Definitions
EmitInterface(event, message)
Returned function from the Emit class created by a user that has connected. This function takes an event and a message object/string and sends it to the user that created the instance
Parameters:
Name | Type | Description |
---|---|---|
event |
string | The name of the emitted event |
message |
string | object | The message being sent |
Example
// emitting any events
socketEmitter.connect(function(socket) {
socket.emit('Hello is there anyone in there?', { just: 'nod if you can hear me' });
});