Created
May 27, 2022 23:52
-
-
Save Crowbrammer/d577a70207be62b0d938bb713c4e6dbb to your computer and use it in GitHub Desktop.
Playing with Integrant REPL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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