@arcblock/event-client
v1.7.1
Published
Helper library to attach a websocket server to any express app
Downloads
17
Readme
Table of Contents
Install
npm install @arcblock/event-client
// or
yarn add @arcblock/event-client
Usage
const EventClient = require('@arcblock/event-client');
const endpoint = 'ws://192.168.43.94:3030';
(async () => {
const hub = new EventClient(endpoint);
const subscription = await hub.subscribe('auth', '2c6e68c5');
const subscription = await hub.subscribe('swap', 'abcd1234');
subscription.on('data', data => console.log('token.update', data));
})();