From 81c9794657132e26896890d6c0f156a366a19bb7 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Mon, 3 Oct 2016 23:01:10 +0200 Subject: [PATCH] Simplify images dashboard initialization event impl. --- src/uxbox/main/data/images.cljs | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/src/uxbox/main/data/images.cljs b/src/uxbox/main/data/images.cljs index b04905a05b..539d19abc8 100644 --- a/src/uxbox/main/data/images.cljs +++ b/src/uxbox/main/data/images.cljs @@ -30,21 +30,12 @@ (assoc-in [:dashboard :images] data) (assoc-in [:dashboard :section] :dashboard/images)))) - ;; rs/EffectEvent - ;; (-apply-effect [_ state] - ;; (when (nil? (:image-colls-by-id state)) - ;; (reset! st/loader true))) - rs/WatchEvent (-apply-watch [_ state s] - (if (nil? (:image-colls-by-id state)) - (rx/merge - (rx/of (fetch-collections)) - (->> (rx/filter collections-fetched? s) - (rx/take 1) - (rx/do #(reset! st/loader false)) - (rx/ignore))) - (rx/empty)))) + (rx/merge + (rx/of (fetch-collections)) + (when (uuid? id) + (rx/of (fetch-images id)))))) (defn initialize [type id]