8000 GitHub - hiredman/drawbridge-cljs: clojurescript client for drawbridge (http nrepl)
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

hiredman/drawbridge-cljs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

# drawbridge-cljs

nrepl/drawbridge client for clojurescript

https://github.com/hiredman/nrepl-cljs-middleware
https://github.com/cemerick/drawbridge/
https://github.com/clojure/tools.nrepl

## Usage

add the following to your project.clj

[drawbridge-cljs "0.0.1"]

(ns foo.bar
  (:require [drawbridge.client :as repl]))

(let [r (repl/nrepl-send
          "/repl" {"op" "compile-cljs"    
                   "code" (pr-str '(+ 1 2))})]
  (add-watch r :close
             (fn [k this _ v]
               (when (= "done"
                        (aget (get (last v) "status") 0))
                 (repl/nrepl-close this)
                 (remove-watch this k))))
  (add-watch r :done
             (fn [k this _ v]
               (when (= "done" (aget (get (last v) "status") 0))
                 (try
                   ((js/eval (get (first v) "javascript")))
                   (catch js/Object e
                     (.log js/console e)))))))
                            


## License

Copyright (C) 2012 Kevin Downey

Distributed under the Eclipse Public License, the same as Clojure.

About

clojurescript client for drawbridge (http nrepl)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0