kienstra / functional-di

How to do Dependency Injection in Clojure without a DI library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Functional DI

An example of Dependency Injection in Clojure, without a DI library.

Here's a post on how this works.

The composition root injects the dependencies.

I didn't implement the production gateways, like editor_gateway.clj.

In a real app, they would interact with the outside world.

For example, editor_gateway.clj would open a terminal in a real code editor.

This repo is just to show how to do Dependency Injection in Clojure.

But the unit tests are complete.

Run unit tests

lein test

License

GPLv2 or later

About

How to do Dependency Injection in Clojure without a DI library

License:Other


Languages

Language:Clojure 100.0%