Make :start value a function call.

In the existing example, `(defstate conn :start create-conn)` simply binds `conn` to the function `create-conn`, rather than the result of calling the function.
This commit is contained in:
Dan Kee 2016-02-29 09:18:02 -06:00
parent c001c19eb5
commit ef4dee6c8a

View file

@ -91,7 +91,7 @@ Pull request away, let's solve this thing!
Creating state is easy:
```clojure
(defstate conn :start create-conn)
(defstate conn :start (create-conn))
```
where the `create-conn` function is defined elsewhere, can be right above it.
@ -99,7 +99,7 @@ where the `create-conn` function is defined elsewhere, can be right above it.
In case this state needs to be cleaned / destroyed between reloads, there is also `:stop`
```clojure
(defstate conn :start create-conn
(defstate conn :start (create-conn)
:stop (disconnect conn))
```