Skip to content

A library that makes integrant a little easier to use

Notifications You must be signed in to change notification settings

xcoo/integrant-tools

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

integrant-tools

A library that makes integrant a little easier to use.

Usage

For example, you can write the following in dev.clj:

(ns dev
  (:require [clojure.tools.namespace.repl :as ns-repl]
            [integrant-tools.core :as ig-tools]))

(ns-repl/set-refresh-dirs "dev/src" "src")

(integrant.repl/set-prep! #(ig-tools/init "config.edn" "local.edn"))

Features

ref

You can use more simpler #ref instead of #ig/ref:

{:adapter/jetty {:port 8080, :handler #ref :handler/greet}
 :handler/greet {:name "Alice"}}

def

You can define a constant by :def such as :duct/const:

{[:def :my-app/config] {:port 8080 :host "localhost"}}

env

Just a #duct/env port:

{:adapter/jetty {:port #env ["PORT" Int :or 8080], :handler ref :handler/greet}
 :handler/greet {:name "Alice"}}

License

Copyright 2020-2021 Xcoo, Inc.

Licensed under the Apache License, Version 2.0.

About

A library that makes integrant a little easier to use

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published