### Install Integrant-REPL Dependency Source: https://github.com/weavejester/integrant-repl/blob/master/README.md Add the Integrant-REPL library as a dependency to your Clojure project using either deps.edn for Clojure CLI or project.clj for Leiningen. ```Clojure integrant/repl {:mvn/version "0.4.0"} ``` ```Clojure [integrant/repl "0.4.0"] ``` -------------------------------- ### Go: Prepare and Initiate System Source: https://github.com/weavejester/integrant-repl/blob/master/README.md The `go` function provides a convenient shortcut to perform both the `prep` and `init` steps sequentially, preparing and initiating the Integrant system in one command. ```Clojure user=> (go) :initiated ``` -------------------------------- ### Initiate Integrant System Source: https://github.com/weavejester/integrant-repl/blob/master/README.md After preparing the configuration, use the `init` function to turn it into a running system. The initiated system is then stored in `integrant.repl.state/system`. ```Clojure user=> (init) :initiated ``` -------------------------------- ### Prepare Integrant Configuration Source: https://github.com/weavejester/integrant-repl/blob/master/README.md Execute the `prep` function in your REPL to prepare the Integrant configuration. This step processes the configuration defined by `set-prep!` and stores it in `integrant.repl.state/config`. ```Clojure user=> (prep) :prepped ``` -------------------------------- ### Require Namespace and Define Integrant Configuration Source: https://github.com/weavejester/integrant-repl/blob/master/README.md In your user.clj file, require the necessary Integrant and Integrant-REPL namespaces. Then, use `integrant.repl/set-prep!` to define a zero-argument function that returns your prepared Integrant configuration, typically expanded and deprofiled. ```Clojure (ns user (:require [integrant.core :as ig] [integrant.repl :refer [clear go halt prep init reset reset-all]])) (def config {::foo {:example? true}}) (integrant.repl/set-prep! #(ig/expand config (ig/deprofile [:dev]))) ``` -------------------------------- ### Reset and Reload Integrant System Source: https://github.com/weavejester/integrant-repl/blob/master/README.md The `reset` function is used to reload source files and restart the Integrant system. It leverages `tools.namespace` to detect and reload changed files before re-initiating the system. ```Clojure user=> (reset) :reloading (...) :resumed ``` -------------------------------- ### Configure tools.namespace Refresh Directories Source: https://github.com/weavejester/integrant-repl/blob/master/README.md Integrant-REPL uses `tools.namespace` for file reloading. You can specify which directories `tools.namespace` should monitor for changes using the `set-refresh-dirs` function from `clojure.tools.namespace.repl`. ```Clojure user=> (require '[clojure.tools.namespace.repl :refer [set-refresh-dirs]]) nil user=> (set-refresh-dirs "src/clj") ("src/clj") ``` -------------------------------- ### Halt Running Integrant System Source: https://github.com/weavejester/integrant-repl/blob/master/README.md To stop a running Integrant system, execute the `halt` function. This will gracefully shut down all components defined in your Integrant configuration. ```Clojure user=> (halt) :halted ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.