1.1.4 • Published 2 years ago

nerio-io-client v1.1.4

Weekly downloads
2
License
MIT
Repository
-
Last release
2 years ago

Io-client

npm npm.io

A websocket client base on socket.io-client, working with io-server

install

npm i nerio-io-client -S

CDN

<script src="https://cdn.jsdelivr.net/npm/nerio-io-client/dist/messenger.js"></script>

Usage

initialize instance

import Client from 'nerio-io-client'

const client = new Client(url, [socketIoOptions, autoCreate])
// const client = new Messenger(url, [socketIoOptions, autoCreate]) // using cdn

subscribe channel

client.subscribe('message')
client.subscribe(['message', 'client-1'])

select channel and broadcast

let channel = client.select('message')
// let channel = client.select(['message', 'client-1'])
channel.broadcast('event-1', {
    payload: 'foo'
})

channel.broadcast({ // default event is: message
    payload: 'foo'
})
1.1.4

2 years ago

1.1.3

3 years ago

1.1.2

3 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago