                                {:on-success #(re-frame/dispatch [:add-locations-before %])})
        true)))
 
+  (re-frame/reg-event-db
+   :add-locations-before
+   (fn [app-db [_ locations]]
+     (add-locations-before app-db locations)))
+
   (re-frame/reg-sub
    :loading-after-buffer
    :<- [:comic-coordinates]

                               buffer-size
                               {:on-success #(re-frame/dispatch [:add-locations-after %])})
       true)))

  (re-frame/reg-sub
   :current-locations

    (if (number? n)
      (concat (take-last n before) current (take n after))
      [])))

(defn add-locations-before [app-db locations]
  (update app-db :locations #(concat locations %)))

(defn add-locations-after [app-db locations]
  (update app-db :locations #(concat % locations)))

(defn setup! []
  (re-frame/reg-sub
