0.0.22 • Published 5 years ago

@tobyt/infoscreenx-active-event-subscriber v0.0.22

Weekly downloads
1
License
ISC
Repository
github
Last release
5 years ago

InfoScreen X Active Event Subscriber

Find more information about InfoScreen X on Github: https://github.com/tobyt42/infoscreen

Usage

The event polling and parsing is done on a web worker thread. You can set up a worker manually or use a module such as worker-loader.

Setting up active event worker

Example active-event.worker.js

import WorkerEventHandler from "@tobyt/infoscreenx-active-event-subscriber/WorkerEventHandler";

new WorkerEventHandler().init(global);

The reason why this class is not provided is that you may wish to configure the worker thread individually. For example, forcing moment-timezone to use a particular timezone. WorkerEventHandler will set the worker's onmessage and will use postMessage to post active events to the subscriber.

Communicating with the active event worker

import ActiveEventSubscriber from "@tobyt/infoscreenx-active-event-subscriber";

const worker; // Set up as per above

const config = {
	eventCallback: function (activeEvent) { /*...*/ },
	dataSource: {
		type: 'poller|mock',
		pollInterval: 20000,
		requestUrl: 'https://...'
	}
}

const subscriber = new ActiveEventSubscriber();
subscriber.start(worker, config);
0.0.22

5 years ago

0.0.21

5 years ago

0.0.20

5 years ago

0.0.19

5 years ago

0.0.18

5 years ago

0.0.17

5 years ago

0.0.16

5 years ago

0.0.15

5 years ago

0.0.14

5 years ago

0.0.13

5 years ago

0.0.12

5 years ago

0.0.11

5 years ago

0.0.10

5 years ago

0.0.9

5 years ago

0.0.8

5 years ago

0.0.7

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1-alpha

6 years ago