@zengruofanzrf/base-websocket
v1.0.1
Published
a common websocket implementation
Downloads
2
Readme
Installation
You can install this package with npm
.
npm
$ npm install -S @zengruofanzrf/base-websocket
Usage
# 获取单例
const singleton = await Ws.getSingleton("ws://server:8080")
# 根据ws消息key,进行事件订阅
singleton.subscribe('ws message key', yourMethod )
# 取消事件订阅
singleton.unSubscribe('ws message key', yourMethod )
LICENSE
MIT