Merge pull request #83 from kenrestivo/master
Add docstring for defstate
This commit is contained in:
commit
8bb5e19303
1 changed files with 5 additions and 1 deletions
|
|
@ -160,7 +160,11 @@
|
||||||
(up s-name with-inst (atom #{})))))
|
(up s-name with-inst (atom #{})))))
|
||||||
|
|
||||||
#?(:clj
|
#?(:clj
|
||||||
(defmacro defstate [state & body]
|
(defmacro defstate
|
||||||
|
"Defines a state. Restarts on recompilation.
|
||||||
|
Pass ^{:on-reload :noop} to prevent auto-restart
|
||||||
|
on ns recompilation, or :stop to stop on recompilation."
|
||||||
|
[state & body]
|
||||||
(let [[state params] (macro/name-with-attributes state body)
|
(let [[state params] (macro/name-with-attributes state body)
|
||||||
{:keys [start stop] :as lifecycle} (apply hash-map params)
|
{:keys [start stop] :as lifecycle} (apply hash-map params)
|
||||||
state-name (with-ns *ns* state)
|
state-name (with-ns *ns* state)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue