(ns com.github.harlanji.clojure-stack.lifecycle
    (:require [com.stuartsierra.component :as component]
              [com.github.harlanji.clojure-stack/core :refer [upon event]]))

(defn- start* [component]
       (upon component (event :component/start)))

(defn- stop* [component]
       (upon component (event :component/stop)))


(defn start [component]
      (if (is? )
        (component/start component)
        (component/update-system component start*)))
(defn stop [component]
      (if (is? )
        (component/stop component)
        (component/update-system-reverse component stop*)))