Remove cb

This commit is contained in:
Florian Schroedl 2024-07-04 09:29:43 +02:00
parent 3793e98660
commit 8370fd06d4

View file

@ -65,10 +65,10 @@
(ptk/reify ::done (ptk/reify ::done
ptk/WatchEvent ptk/WatchEvent
(watch [_ _ _] (watch [_ _ _]
(rx/from (p/resolved true))))) (rx/of :the/end))))
(defn apply-token (defn apply-token
[{:keys [attributes shape-ids token on-update-shape cb] :as _props}] [{:keys [attributes shape-ids token on-update-shape] :as _props}]
(ptk/reify ::apply-token (ptk/reify ::apply-token
ptk/WatchEvent ptk/WatchEvent
(watch [_ state _] (watch [_ state _]
@ -80,14 +80,10 @@
tokenized-attributes (->> (map (fn [attr] {attr (:id token)}) attributes) tokenized-attributes (->> (map (fn [attr] {attr (:id token)}) attributes)
(into {}))] (into {}))]
(rx/of (rx/of
(dch/update-shapes shape-ids (fn [shape] (update shape :applied-tokens merge tokenized-attributes))) (dch/update-shapes shape-ids (fn [shape]
(when cb (update shape :applied-tokens merge tokenized-attributes)))
(cb))
(when on-update-shape (when on-update-shape
(on-update-shape resolved-value shape-ids attributes)))) (on-update-shape resolved-value shape-ids attributes))))))))))
#_(rx/of
(dch/update-shapes shape-ids #(assoc % :applied-tokens {:found 1})))))))))
(def remove-keys #(apply dissoc %1 %2)) (def remove-keys #(apply dissoc %1 %2))