npm.io
3.3.0 • Published 10 years ago

ftlabs-screens-viewer

Licence
ISC
Version
3.3.0
Deps
1
Vulns
0
Weekly
0

Screens-Viewer

Circle CI

Connects to a screens server with websockets and fires events on url change.

Example Usage


const Viewer = require('ftlabs-screens-viewer');

// Create new viewer, give the url of the api which should be connected to.
// storageObject is a persistend storage object has asynchronous getItem and setItem methods.
const viewer = new Viewer('https://example.com', storageObject);
viewer.start();

// The url has changed
viewer.on('change', updateFrameURL);

// A reload has been forced
viewer.on('reload', reloadFrame);

// E.g. The viewer has started but cannot connected to the server.
viewer.on('not-connected', showOfflineMessage);

Developing

Dependencies go into build/package.json so they get installed from production.

Commands:

npm run build - Builds npm run test - Runs tests