From c95a9ec7ba42248883f2576be6b6a9fe092e0f27 Mon Sep 17 00:00:00 2001 From: Dan Holmsand Date: Tue, 8 Sep 2015 18:07:29 +0200 Subject: [PATCH] content to set-content --- demo/reagentdemo/core.cljs | 4 ++-- demo/reagentdemo/news.cljs | 2 +- demo/reagentdemo/news/anyargs.cljs | 2 +- demo/reagentdemo/news/async.cljs | 2 +- demo/reagentdemo/news/clockpost.cljs | 2 +- demo/reagentdemo/news/news050.cljs | 2 +- demo/reagentdemo/news/undodemo.cljs | 2 +- demo/sitetools/core.cljs | 15 ++++++--------- 8 files changed, 14 insertions(+), 17 deletions(-) diff --git a/demo/reagentdemo/core.cljs b/demo/reagentdemo/core.cljs index 4fa67ef..c6cde47 100644 --- a/demo/reagentdemo/core.cljs +++ b/demo/reagentdemo/core.cljs @@ -31,9 +31,9 @@ (def title "Minimalistic React for ClojureScript") (defroute "/" [] - (dispatch [:content [#'intro/main] title])) + (dispatch [:set-content [#'intro/main] title])) (defroute main-page "/index.html" [] - (dispatch [:content [#'intro/main] title])) + (dispatch [:set-content [#'intro/main] title])) (tools/reg-page (main-page)) diff --git a/demo/reagentdemo/news.cljs b/demo/reagentdemo/news.cljs index f111b0e..fdd6f4a 100644 --- a/demo/reagentdemo/news.cljs +++ b/demo/reagentdemo/news.cljs @@ -16,5 +16,5 @@ [undodemo/main {:summary true}]]) (defroute path "/news/index.html" [] - (dispatch [:content [#'main] "News"])) + (dispatch [:set-content [#'main] "News"])) (tools/reg-page (path)) diff --git a/demo/reagentdemo/news/anyargs.cljs b/demo/reagentdemo/news/anyargs.cljs index ca13021..9934e98 100644 --- a/demo/reagentdemo/news/anyargs.cljs +++ b/demo/reagentdemo/news/anyargs.cljs @@ -13,7 +13,7 @@ (declare main) (defroute path "/news/any-arguments.html" [] - (dispatch [:content [#'main] title])) + (dispatch [:set-content [#'main] title])) (tools/reg-page (path)) diff --git a/demo/reagentdemo/news/async.cljs b/demo/reagentdemo/news/async.cljs index dc43251..72a81f1 100644 --- a/demo/reagentdemo/news/async.cljs +++ b/demo/reagentdemo/news/async.cljs @@ -12,7 +12,7 @@ (declare main) (defroute path "/news/reagent-is-async.html" [] - (dispatch [:content [#'main] title])) + (dispatch [:set-content [#'main] title])) (tools/reg-page (path)) diff --git a/demo/reagentdemo/news/clockpost.cljs b/demo/reagentdemo/news/clockpost.cljs index 2136d28..010419c 100644 --- a/demo/reagentdemo/news/clockpost.cljs +++ b/demo/reagentdemo/news/clockpost.cljs @@ -13,7 +13,7 @@ (declare main) (defroute path "/news/binary-clock.html" [] - (dispatch [:content [#'main] title])) + (dispatch [:set-content [#'main] title])) (tools/reg-page (path)) diff --git a/demo/reagentdemo/news/news050.cljs b/demo/reagentdemo/news/news050.cljs index 3a9e28c..6acf4c8 100644 --- a/demo/reagentdemo/news/news050.cljs +++ b/demo/reagentdemo/news/news050.cljs @@ -12,7 +12,7 @@ (declare main) (defroute path "/news/news050.html" [] - (dispatch [:content [#'main] title])) + (dispatch [:set-content [#'main] title])) (tools/reg-page (path)) diff --git a/demo/reagentdemo/news/undodemo.cljs b/demo/reagentdemo/news/undodemo.cljs index e4c3d84..7329d05 100644 --- a/demo/reagentdemo/news/undodemo.cljs +++ b/demo/reagentdemo/news/undodemo.cljs @@ -13,7 +13,7 @@ (declare main) (defroute path "/news/cloact-reagent-undo-demo.html" [] - (dispatch [:content [#'main] title])) + (dispatch [:set-content [#'main] title])) (tools/reg-page (path)) diff --git a/demo/sitetools/core.cljs b/demo/sitetools/core.cljs index 5128bef..37d56eb 100644 --- a/demo/sitetools/core.cljs +++ b/demo/sitetools/core.cljs @@ -47,15 +47,12 @@ (defn demo-handler [state [id v1 v2 :as event]] (case id - :content (do - (let [title (if v2 - (str (:title-prefix state) v2) - (str (:default-title state)))] - (when r/is-client - (r/next-tick #(set! js/document.title title))) - (assoc state - :main-content v1 - :title title))) + :set-content (let [title (if v2 + (str (:title-prefix state) v2) + (str (:default-title state)))] + (when r/is-client + (r/next-tick #(set! js/document.title title))) + (assoc state :main-content v1 :title title)) :set-page (do (secretary/dispatch! v1) (assoc state :page-name v1)) :goto-page (do