Skip to content

Instantly share code, notes, and snippets.

@Crowbrammer
Created May 27, 2022 23:52
Show Gist options
  • Save Crowbrammer/d577a70207be62b0d938bb713c4e6dbb to your computer and use it in GitHub Desktop.
Save Crowbrammer/d577a70207be62b0d938bb713c4e6dbb to your computer and use it in GitHub Desktop.
Playing with Integrant REPL
(ns user
(:require [integrant.core :as ig]
[integrant.repl :refer [go halt prep reset reset-all set-prep!]]
[integrant.repl.state :as state]))
;; Getting one key setup.
(def config
{:boop/test-1 (ig/ref :shoop/test-2)
:shoop/test-2 "Boop"})
(defmethod ig/init-key :boop/test-1
[_ s]
(println s))
(defmethod ig/init-key :shoop/test-2
[_ s]
(if (= s "Boop")
"Dragonn"
s))
;;(ig/init config)
(set-prep! (fn [] config))
(def boop (-> state/system :shoop/test-2))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment