@jbl-system/messenger
v1.0.2
Published
A wrapper around socket.io-client for JBL System.
Downloads
4
Readme
This is a wrapper around socket.io-client for JBL System.
How to use
Install using npm
with:
npm i @jbl-system/messenger
import Messenger from "@jbl-system/messenger"
useEffect(() => {
socket = socket || new Messenger(baseURI.notification, true)
socket.onEvent('connect', () => {
socket.Subscribe('webScanner', ['position-pinned', 'update-last-position', 'position-updated']);
});
socket.onEvent('reconnect', () => {
socket.Subscribe('webScanner', ['position-pinned', 'update-last-position', 'position-updated']);
});
socket.onEvent('update-last-position', (data: TRowLastPosition) => {
....
});
return () => {
socket = socket.disconnect()
};
}, []) ...
Release Notes
Ver 1.0.2 supports React 18