2
0

user.clj 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. (ns user
  2. (:require
  3. [figwheel-sidecar.repl-api :as f]))
  4. ;; user is a namespace that the Clojure runtime looks for and
  5. ;; loads if its available
  6. ;; You can place helper functions in here. This is great for starting
  7. ;; and stopping your webserver and other development services
  8. ;; The definitions in here will be available if you run "lein repl" or launch a
  9. ;; Clojure repl some other way
  10. ;; You have to ensure that the libraries you :require are listed in your dependencies
  11. ;; Once you start down this path
  12. ;; you will probably want to look at
  13. ;; tools.namespace https://github.com/clojure/tools.namespace
  14. ;; and Component https://github.com/stuartsierra/component
  15. (defn fig-start
  16. "This starts the figwheel server and watch based auto-compiler."
  17. []
  18. ;; this call will only work are long as your :cljsbuild and
  19. ;; :figwheel configurations are at the top level of your project.clj
  20. ;; and are not spread across different lein profiles
  21. ;; otherwise you can pass a configuration into start-figwheel! manually
  22. (f/start-figwheel!))
  23. (defn fig-stop
  24. "Stop the figwheel server and watch based auto-compiler."
  25. []
  26. (f/stop-figwheel!))
  27. ;; if you are in an nREPL environment you will need to make sure you
  28. ;; have setup piggieback for this to work
  29. (defn cljs-repl
  30. "Launch a ClojureScript REPL that is connected to your build and host environment."
  31. []
  32. (f/cljs-repl))