          (if (pos? @selected-page)
            [:div.button.prev-page {:on-click #(dispatch [event (dec @selected-page)])} "<"]
            [:div.button.prev-page.disabled "<"])
-         (mapcat (fn [[prev cur]]
-                   [(when (and (some? prev) (> (- cur prev) 1))
-                      [:div.button.separator.disabled "···"])
-                    [page-button #(dispatch [event cur]) @selected-page cur]])
-                 (partition 2 1 (cons nil shown-pages)))
+         (doall
+           (mapcat (fn [[prev cur]]
+                     [(when (and (some? prev) (> (- cur prev) 1))
+                        ^{:key (str id "separator-" cur)}
+                        [:div.button.separator.disabled "···"])
+                      ^{:key (str id "button-" cur)}
+                      [page-button #(dispatch [event cur]) @selected-page cur]])
+                   (partition 2 1 (cons nil shown-pages))))
          (if (< @selected-page (dec num-pages))
            [:div.button.next-page {:on-click #(dispatch [event (inc @selected-page)] inc)} ">"]
            [:div.button.next-page.disabled ">"])]))))

                                        :selected)}
   (inc num)])

(defn pager [event subscription num-pages]
  (let [selected-page (subscribe subscription)]
    (fn pager-render [event subscription num-pages]
      (let [shown-pages (if (<= num-pages 7)
                          (range 0 num-pages)
                          (concat [0]

    (fn with-paging-render [page-event page-subsription data-subscription component]
      (let [num-pages (Math/ceil (/ (count @data) items-per-page))]
        [:div
         [pager (str page-event "-1-") page-event page-subscription num-pages]
         [component (->> @data
                         (drop (* @page items-per-page))
                         (take items-per-page))]
         [pager (str page-event "-2-") page-event page-subscription num-pages]]))))
