 
 
 (defn ->interceptor
-  "A utility function for creating interceptors. 
-   
-   Accepts three optional, named arguments:
-   
+  "A utility function for creating interceptors.
+
+  Accepts three optional, named arguments:
+
      - `:id` - an id for the interceptor (decorative only)
-     - `:before` - the interceptor's before function 
-     - `:after`  - the interceptor's after function 
-   
-   Example use:
+     - `:before` - the interceptor's before function
+     - `:after`  - the interceptor's after function
+
+  Example use:
 
       (def my-interceptor
-        (->interceptor                
-         :id     :my-interceptor       
+        (->interceptor
+         :id     :my-interceptor
          :before (fn [context]            ;; you normally want to change :coeffects
                    ... in here use get-coeffect  and assoc-coeffect)
          :after  (fn [context]                         ;; you normally want to change :effects

  (utils/apply-kw interceptor/->interceptor m))

(defn get-coeffect
  "A utility function, typically used when writing an interceptor's `:before` function.  
   
   When called with one argument, it returns the `:coeffects` map from with that `context`.
   
   When called with two or three arguments, behaves like `clojure.core/get` and
   returns the value mapped to `key` in the `:coeffects` map within `context`, `not-found` or
   `nil` if `key` is not present."

(defn reg-event-fx
  "Register the given event `handler` (function) for the given `id`. Optionally, provide
  an `interceptors` chain:

    - `id` is typically a namespaced keyword  (but can be anything)
    - `handler` is a function: (coeffects-map event-vector) -> effects-map
    - `interceptors` is a collection of interceptors. Will be flattened and nils removed.

   Note: `handler` is wrapped in its own interceptor and added to the end of the interceptor
       chain, so that, in the end, only a chain is registered.
   "
