@gdyfe/elcps-msg
v0.1.2
Published
ELCPS's Message framework
Readme
ELCPS-MSG
ELCPS's Message framework
Install
NPM(Recommended)
sudo npm install @gdyfe/elcps-msg --save
sudo yarn add @gdyfe/elcps-msgBrowser
Coming soon
Usage
Initialize
const websocketAddress = 'ws://xxx.xxx.xxx.xxx:xxxx'
const msgHandler = new LcpsMsg(websocketAddress, instanceId, msgCallback, reconnectSuccessCallback)Send
Method: LcpsMsg.Send(msg: TMsg): void
type TMsg = {
server: string
data: {
cmd: string
data?: any
}
} | stringExample:
const res = await msgHandler.Send(msg)Close
Method: LcpsMsg.Close(): void
