cameronwp / endpoint

Simplified socket.io messaging.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Endpoint

Abstracts socket.io messaging into a simpler interface.

This is the base class inherited by client-endpoint and server-endpoint.

npm i -S @cameronwp/endpoint

API

Classes

Endpoint

Functions

onmessage(type, [historical])subscription

Subscribe an action to perform when a message is received.

onchange()subscription

Subscribe an action to perform when the connection changes.

clear()

Remove all subscriptions to connection events.

Typedefs

connectionCallback : function

Connection callback.

changeCallback : function

Changed connction callback.

messageResponse : function

Message response callback.

Endpoint

Kind: global class

new Endpoint()

Base class for handling socket.io connections.

onmessage(type, [historical]) ⇒ subscription

Subscribe an action to perform when a message is received.

Kind: global function

Param Type Default Description
type string
messageResponse
[historical] boolean false Whether or not to call the listener if this message has been received before this listener was set.

onchange() ⇒ subscription

Subscribe an action to perform when the connection changes.

Kind: global function

Type
changeCallback

clear()

Remove all subscriptions to connection events.

Kind: global function

connectionCallback : function

Connection callback.

Kind: global typedef

Param Type Description
sID string Socket ID.

changeCallback : function

Changed connction callback.

Kind: global typedef

Param Type Description
count number Number of connections

messageResponse : function

Message response callback.

Kind: global typedef

Param Type
response any

About

Simplified socket.io messaging.

License:Apache License 2.0


Languages

Language:JavaScript 100.0%