Skip to content
This repository has been archived by the owner on Jul 24, 2019. It is now read-only.

Commit

Permalink
v0.0.21 Add on-close handler to create options
Browse files Browse the repository at this point in the history
  • Loading branch information
PEZ committed Dec 24, 2018
1 parent c0eeb30 commit d3341b6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
2 changes: 1 addition & 1 deletion packages/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cospaia/calva-lib",
"version": "0.0.20",
"version": "0.0.21",
"description": "The Calva Common Library",
"main": "calva.main.js",
"files": [
Expand Down
9 changes: 2 additions & 7 deletions src/calva/repl/client.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@


(defn- make-nrepl-client
[{:keys [host port on-connect]}]
[{:keys [host port on-connect on-close]}]
(let [*results (atom {})

config
Expand All @@ -40,16 +40,11 @@
(when (= 0 (.-length buffer))
(js/console.warn "EMPTY BUFFER"))
(not-empty (decode [buffer]))))
;;(bencode/decode chunk))

:socket/encoder
(fn [data]
(bencoder/encode (jsify data)))}

on-close
(fn [_ error?]
(js/console.log "Disconnected."))

on-data
(fn [_ decoded-messages]
(mapv (fn [decoded]
Expand All @@ -61,7 +56,7 @@
(swap! *results dissoc d-id)
(cb (jsify results)))))))
decoded-messages)
(println (pr-str "*results pending" @*results)))
#_(println (pr-str "*results pending" @*results)))

{:socket.api/keys [write! connected? end!]}
(talky/make-socket-client
Expand Down

0 comments on commit d3341b6

Please sign in to comment.