GithubHelp home page GithubHelp logo

integrant-repl's Introduction

Integrant-REPL

A Clojure library that implements the user functions of Stuart Sierra's reloaded workflow for Integrant.

It's very similar to reloaded.repl, except that it works for Integrant, rather than Component.

Install

Add the following dependency to your dev profile:

[integrant/repl "0.2.0"]

Usage

Require the integrant.repl namespace in your user.clj file, and use the set-prep! function to define a zero-argument function that returns an Integrant configuration.

For example:

(ns user
  (:require [integrant.repl :refer [clear go halt init reset reset-all]]))

(integrant.repl/set-prep! (constantly {::foo {:example? true}}))

To prepare the configuration, you can now use:

user=> (prep)
:prepped

The configuration is stored in integrant.repl.state/config. To initiate the configuration, use:

user=> (init)
:initiated

This will turn the configuration into a running system, which is stored in integrant.repl.state/system.

Because these two steps are common, we can instead use:

user=> (go)
:initiated

This performs the (prep) and (init) steps together. Once the system is running, we can stop it at any time:

user=> (halt)
:halted

If we want to reload our source files and restart the system, we can use:

user=> (reset)
:reloading (...)
:resumed

License

Copyright © 2017 James Reeves

Released under the MIT license.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.