 	c1 (->C :c1 0 :c "c1-data")
 	c2 (->C :c2 0 :c "c2-data")]
     (is (= [[{}{}]{}{}] (data join)))
+    (is (= {} (data joined-model)))
 
     (attach join view)
     (is (= nil (data view)))


;; TODO: return a pair - first is notification fn, second is new-indeces - use swap*! to apply

(defn- rhs-upsert [old-indeces i lhs-key rhs-ks v join-fn]
  (println "rhs-upsert: " old-indeces i rhs-ks v join-fn)
  (let [
	old-index (nth old-indeces i)
	key (lhs-key v)

(defn- rhs-upserts [old-indeces i ks vs join-fn])
(defn- rhs-deletes [old-indeces i ks vs join-fn])

(defn- rhs-view [indeces i key keys join-fn joined-model]
  (reify
   View
   ;; singleton changes
   (on-upsert [_ upsertion] ((swap*! indeces rhs-upsert i key keys upsertion join-fn joined-model) []) nil) ;TODO: pass in views to notifier
   (on-delete [_ deletion]  (swap! indeces rhs-delete i keys deletion join-fn) nil)
   ;; batch changes
   (on-upserts [_ upsertions] (swap! indeces rhs-upserts i keys upsertions join-fn) nil)
