10 var JS = Elm.JavaScript;
12 function open(url) { return function(outgoing) {
13 var incoming = Elm.Signal.constant(Elm.Native.List.Nil);
14 var ws = new window.WebSocket(JS.castStringToJSString(url));
19 ws.onopen = function(e) {
20 var len = pending.length;
21 for (var i = 0; i < len; ++i) { ws.send(pending[i]); }
24 ws.onmessage = function(event) {
25 Dispatcher.notify(incoming.id, JS.castJSStringToString(event.data));
29 var s = JS.castStringToJSString(msg);
30 ready ? ws.send(s) : pending.push(s);
33 function take1(x) { return function(y) { return x; } }
34 return Elm.Signal.lift2(take1)(incoming)(Elm.Signal.lift(send)(outgoing));
38 Elm.Native.WebSocket = {open:open};
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list