Skip to content

Instantly share code, notes, and snippets.

@m0smith m0smith/diclosure.clj
Last active Aug 29, 2015

Embed
What would you like to do?
Dependency Injection in Clojure 4 - Closure
(defn wrap-context [context]
(let [db (:db context})]
(letfn [
(foo [] (update! db "foo"))
(app [] (foo))]
app)))
(let [app-fn (wrap-context (init-context))]
(app-fn))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.