0.0.22 • Published 6 years ago

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

Weekly downloads
1
License
ISC
Repository
github
Last release
6 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

6 years ago

0.0.21

7 years ago

0.0.20

7 years ago

0.0.19

7 years ago

0.0.18

7 years ago

0.0.17

7 years ago

0.0.16

7 years ago

0.0.15

7 years ago

0.0.14

7 years ago

0.0.13

7 years ago

0.0.12

7 years ago

0.0.11

7 years ago

0.0.10

7 years ago

0.0.9

7 years ago

0.0.8

7 years ago

0.0.7

7 years ago

0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1-alpha

7 years ago