   "Functions and helpers for work in a clojure
   way with ratpack types."
   (:require [catacumba.utils :as utils]
-            [catacumba.impl.helpers :as helpers])
+            [catacumba.impl.helpers :as ch])
   (:import ratpack.handling.Handler
            ratpack.handling.Context
            ratpack.handling.RequestOutcome

  response transformations."
  [^DefaultContext context callback]
  (let [^Response response (:response context)]
    (.beforeSend response (helpers/action callback))))

  when the connection with the client is closed."
  [^DefaultContext context callback]
  (let [^Context ctx (:catacumba/context context)]
    (.onClose ctx (ch/fn->action callback))))

(defn before-send
  "Register a callback in the context that will be called
