tolitius / mount

managing Clojure and ClojureScript app state since (reset)
Eclipse Public License 1.0
1.22k stars 88 forks source link

mount/start-with should also take instances #45

Closed tolitius closed 8 years ago

tolitius commented 8 years ago

While this works fine:

(mount/start-with {#'app.sms/send-sms #'test.app/send-sms})

it requires #'test.app/send-sms to be created, which could make it hard to narrow down the scope for the test (to a let binding).

Have start-with to take instances instead [(!) breaking, but worth it] / as an addition to [might not worth it]:

(let [sms-ch (chan)
      send-sms (fn [sms] (go (>! sms-ch sms)))]
  (mount/start-with {#'app.sms/send-sms send-sms})
  ;; testing.. and
  (mount/stop))
tolitius commented 8 years ago

in 0.1.9-SNAPSHOT