From f1ae651e055a7987f7580313793537ea8c395f21 Mon Sep 17 00:00:00 2001 From: Alexander Bazo Date: Tue, 20 Aug 2019 16:46:09 +0200 Subject: [PATCH] Update usage information in Readme --- Readme.md | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/Readme.md b/Readme.md index ecce6d0..64eb6c6 100644 --- a/Readme.md +++ b/Readme.md @@ -4,27 +4,25 @@ A javascript library to subscribe to local gaze data streams in the OTH/UR Eyetr ## Usage -Add the library: +**Add the library:** ``` ``` -Connect to a running *GazeServer*: +**Create a client and subscribe to gaze events:** ``` var gclient = new GazeClient(); -gclient.connect("ws://localhost:8001/gaze"); +gclient.addEventListener("gazeDataAvailable", function onGazeDataAvailable(event) { + console.log(event); +}); ``` -Subscribe to gaze events: +**Connect to a running gaze data server:** ``` -gclient.addEventListener("gazeDataAvailable", onGazeDataAvailable); - -function onGazeDataAvailable(event) { - console.log(event); -} +gclient.connect("ws://localhost:8001/gaze"); ``` -- libgit2 0.26.0