 
 (defn- path
   [query-v]
-  [:via/subs :cache query-v])
+  [:via.subs/cache query-v])
 
 (defn- via-subscribe
   [endpoint query-v]

  (via/dispose endpoint sub-key))

(defn subscribe
  [[query-id & _ :as query-v]]
  (if (get @subscriptions query-v)
    (re-frame/subscribe query-v)
    (do
      (reg-sub-raw
       query-id
       (fn [db query-v]
         (swap! subscriptions conj query-v)
         (make-reaction
          #(get-in @db (path query-v))
          :on-dispose #(swap! subscriptions disj query-v))))
      (swap! subscriptions conj query-v)
      (re-frame/subscribe query-v))))

(reg-event-via
 :via.subs.db/updated

(ns via.subs
  (:require [via.events :refer [reg-event-via]]
            [via.endpoint :as via]
            [utilis.types.keyword :refer [->keyword]]
            [re-frame.core :refer [reg-sub-raw reg-event-db dispatch] :as re-frame]
            [reagent.ratom :refer [make-reaction]]
            [integrant.core :as ig]
