Liking cljdoc? Tell your friends :D

watch.core

clj

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.
cljs

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.
raw docstring

enough-millisclj/s

source (clj)source (cljs)

ensure-fileclj

(ensure-file f)
sourceraw docstring

fscljs

source

ns-to-filenameclj

(ns-to-filename require-def options)
source

reloadclj/s≠macro

clj
(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))
cljs
(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")))
source (clj)source (cljs)raw docstring

stopclj/s

(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.
source (clj)source (cljs)raw docstring

stop-allclj/s

(stop-all)

Stop all watching from a hashmap of descriptors.

Stop all watching from a hashmap of descriptors.
source (clj)source (cljs)raw docstring

waiting-millisclj/s

source (clj)source (cljs)

watchclj/s

(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))
source (clj)source (cljs)raw docstring

watch-debugclj

(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.
sourceraw docstring

watch-entryclj/s

(watch-entry f watcher)
source (clj)source (cljs)

watchedclj/s

(watched)

Return the watched file names from the user hashmap.

Return the watched file names from the user hashmap.
source (clj)source (cljs)raw docstring

watched-filesclj/s≠

cljs

Descriptors.

Descriptors.
source (clj)source (cljs)raw docstring

watched?clj

(watched? f)

Tells if a file is being watched.

Tells if a file is being watched.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close