index.js 484 Bytes
Newer Older
Alexander Bazo committed
1 2 3 4 5
/* eslint-env browser */
/* global GazeClient */

var gclient = new GazeClient();
gclient.connect("ws://localhost:8001/gaze");
Alexander Bazo committed
6 7 8 9 10 11 12
gclient.addEventListener("connectionopened", onConnected);
gclient.addEventListener("dataAvailable", onGazeDataAvailable);
gclient.addEventListener("connectionclosed", onDisconnected);

function onConnected(event) {
	console.log(event);
}
13 14 15

function onGazeDataAvailable(event) {
	console.log(event);
Alexander Bazo committed
16 17 18 19
}

function onDisconnected(event) {
	console.log(event);
20
}