Created
March 3, 2018 23:41
-
-
Save ondrej-kvasnovsky/24a758eb0b1d03d922033f65185764f0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function init() { | |
| registerHandler(); | |
| } | |
| let eventBus; | |
| function registerHandler() { | |
| eventBus = new EventBus('http://localhost:8080/eventbus'); | |
| eventBus.onopen = function () { | |
| eventBus.registerHandler('out', function (error, message) { | |
| const counter = message.body; | |
| document.getElementById('current_value').innerHTML = counter; | |
| }); | |
| } | |
| } | |
| function increment() { | |
| eventBus.send('in') | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment