This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-04-01
Channels
- # announcements (14)
- # beginners (6)
- # biff (6)
- # calva (3)
- # cider (7)
- # clojure (79)
- # clojure-europe (5)
- # clojure-norway (9)
- # cursive (9)
- # data-science (20)
- # datomic (3)
- # fulcro (9)
- # graalvm (15)
- # integrant (2)
- # introduce-yourself (2)
- # jobs (1)
- # lsp (7)
- # malli (5)
- # off-topic (130)
- # parinfer (11)
- # pedestal (11)
- # portal (1)
- # practicalli (4)
- # releases (3)
- # remote-jobs (1)
- # ring (8)
- # ring-swagger (30)
- # shadow-cljs (9)
- # sql (10)
- # tools-deps (8)
I’m wondering if there’s a way to swap out init keys based on the profile being run? I know it’s possible to pass different values to an init key based on the profile, like passing different refs or strings to a DB config. What I’m interested in is using a separate implementation of the init-key based on the profile. For example a :dev/file-server
that just writes to disk, and a :prod/file-server
that actually sends the file to a file server over the network. What it seems to be doing now is just initializing both.
Apologies if this is a common question, I searched for a while and couldn’t find anything.
I think https://github.com/weavejester/integrant/issues/81#issuecomment-615906828 comment describes how you can use derived keys to do what you want. You specify some abstract root keyword (e.g. :application/file-server
or whatever), refer to it in all those components that need a file server dependency and finally derive both :dev/file-server
and :prod/file-server
from the common root keyword. Checkout derived keys and composite keys in the integrant readme.