[docs]: on start-without
This commit is contained in:
parent
4ec7bb5e57
commit
46d2f98c73
1 changed files with 16 additions and 0 deletions
16
README.md
16
README.md
|
|
@ -24,6 +24,7 @@ _**Alan J. Perlis** from [Structure and Interpretation of Computer Programs](htt
|
|||
- [The Importance of Being Reloadable](#the-importance-of-being-reloadable)
|
||||
- [Start and Stop Order](#start-and-stop-order)
|
||||
- [Start and Stop Parts of Application](#start-and-stop-parts-of-application)
|
||||
- [Start an Application Without Certain States](#start-an-application-without-certain-states)
|
||||
- [Mount and Develop!](#mount-and-develop)
|
||||
- [Running New York Stock Exchange](#running-new-york-stock-exchange)
|
||||
- [Web and Uberjar](#web-and-uberjar)
|
||||
|
|
@ -210,6 +211,21 @@ which will only start/stop `app-config` and `conn` (won't start any other states
|
|||
|
||||
Here is an [example](test/check/parts_test.clj) test that uses only two namespaces checking that the third one is not started.
|
||||
|
||||
## Start an Application Without Certain States
|
||||
|
||||
Whether it is in REPL or during testing, it is often useful to start an application _without_ certain states. These can be queue listeners that are not needed at REPL time, or a subset of an application to test.
|
||||
|
||||
The `start-without` function can do just that:
|
||||
|
||||
```clojure
|
||||
(mount/start-without #'app.feeds/feed-listener
|
||||
#'app/nrepl)
|
||||
```
|
||||
|
||||
which will start an application without starting `feed-listener` and `nrepl` states.
|
||||
|
||||
Here is an [example](test/check/without_test.clj) test that excludes Datomic connection and nREPL from an application on start.
|
||||
|
||||
## Mount and Develop!
|
||||
|
||||
`mount` comes with an example [app](https://github.com/tolitius/mount/tree/master/test/app)
|
||||
|
|
|
|||
Loading…
Reference in a new issue