goog.provide('scittle.nrepl');
scittle.nrepl.ws_url = (function scittle$nrepl$ws_url(host,port,path){
return ["ws://",cljs.core.str.cljs$core$IFn$_invoke$arity$1(host),":",cljs.core.str.cljs$core$IFn$_invoke$arity$1(port),"/",cljs.core.str.cljs$core$IFn$_invoke$arity$1(path)].join('');
});
var temp__5804__auto___50215 = window.SCITTLE_NREPL_WEBSOCKET_PORT;
if(cljs.core.truth_(temp__5804__auto___50215)){
var ws_port_50216 = temp__5804__auto___50215;
(window.ws_nrepl = (new WebSocket(scittle.nrepl.ws_url(window.location.hostname,ws_port_50216,"_nrepl"))));
} else {
}
var temp__5804__auto___50217 = sci.nrepl.server.nrepl_websocket();
if(cljs.core.truth_(temp__5804__auto___50217)){
var ws_50218 = temp__5804__auto___50217;
(ws_50218.onmessage = (function (event){
return sci.nrepl.server.handle_nrepl_message(clojure.edn.read_string.cljs$core$IFn$_invoke$arity$1(event.data));
}));

(ws_50218.onerror = (function (event){
return console.log(event);
}));
} else {
}

//# sourceMappingURL=scittle.nrepl.js.map
