Allos you to (mainly) reload your namespaces in an simple way or do other things when your files are modified.
Allos you to (mainly) reload your namespaces in an simple way or do other things when your files are modified.
Allos you to (mainly) reload your namespaces in an simple way or do other things when your files are modified. It is intended for clojurecript repl over nodejs or lumo.
Allos you to (mainly) reload your namespaces in an simple way or do other things when your files are modified. It is intended for clojurecript repl over nodejs or lumo.
(reload require-def & actions)
Load and reload a namespace using a namespace definition and optional parameters and actions. It executes all actions every time the namespace file changes, and prints "Reloading " with your namespace definition. It uses 'require' to do the job and if you are having trouble you can use macroexpand-1 too see if it is generating the correct file name to watch.
(reload [watch.test-ns :as tns]) (reload [watch.test-ns :as tns] {:ext :cljs :src "opt-src"}) (reload [watch.test-ns :as tns] (println :a) (println :b)) (reload [watch.test-ns :as tns] {:ext :cljs :src "opt-src"} (println :b) (println :c))
Load and reload a namespace using a namespace definition and optional parameters and actions. It executes all actions every time the namespace file changes, and prints "Reloading " with your namespace definition. It uses 'require' to do the job and if you are having trouble you can use macroexpand-1 too see if it is generating the correct file name to watch. (reload [watch.test-ns :as tns]) (reload [watch.test-ns :as tns] {:ext :cljs :src "opt-src"}) (reload [watch.test-ns :as tns] (println :a) (println :b)) (reload [watch.test-ns :as tns] {:ext :cljs :src "opt-src"} (println :b) (println :c))
(reload &form &env rou file & actions)
Reload a namespace every time a file is modified. It can also dispatch multiple actions. The macro returns the watch descriptor alone. If the reloading fails the actions are not executed.
Ej. (def b (reload (require '[clojure.string :as st]) "t.clj" (println "hola") (println "adios")))
Reload a namespace every time a file is modified. It can also dispatch multiple actions. The macro returns the watch descriptor alone. If the reloading fails the actions are not executed. Ej. (def b (reload (require '[clojure.string :as st]) "t.clj" (println "hola") (println "adios")))
(stop f)
Stop a watch using the watch descriptor or using a hashmap of descriptors (gotten from watch fn) and the file name to stop watching.
Stop a watch using the watch descriptor or using a hashmap of descriptors (gotten from watch fn) and the file name to stop watching.
(stop-all)
Stop all watching from a hashmap of descriptors.
Stop all watching from a hashmap of descriptors.
(watch f hn)
Observes a file and executes a handler. Receives a hashmap to associate the watch descriptor using the filename as key. The handler function receives the ctx and the event descriptor. The handler are dispatched ONLY when the file is modified. You can only define a watch per file, as the watch descriptor is associated in the hm by key. If you need to associate many watches to a file, it is better to use hawk directly.
Ej. (watch "test.clj" (fn wtestwt [ctx e] nil))
Observes a file and executes a handler. Receives a hashmap to associate the watch descriptor using the filename as key. The handler function receives the ctx and the event descriptor. The handler are dispatched ONLY when the file is modified. You can only define a watch per file, as the watch descriptor is associated in the hm by key. If you need to associate many watches to a file, it is better to use hawk directly. Ej. (watch "test.clj" (fn wtestwt [ctx e] nil))
(watch-debug f)
Observes all events from file name and print it on the console. Return the watch descriptor.
Observes all events from file name and print it on the console. Return the watch descriptor.
(watched)
Return the watched file names from the user hashmap.
Return the watched file names from the user hashmap.
(watched? f)
Tells if a file is being watched.
Tells if a file is being watched.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close