From aa0f9fc4d2b26fd1d2e73014d201512b221e5d57 Mon Sep 17 00:00:00 2001 From: Stuart Mitchell Date: Thu, 26 Feb 2015 15:35:01 +1300 Subject: [PATCH] changed location of initization --- examples/todomvc/src/todomvc/core.cljs | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/examples/todomvc/src/todomvc/core.cljs b/examples/todomvc/src/todomvc/core.cljs index 550392b..b988c30 100644 --- a/examples/todomvc/src/todomvc/core.cljs +++ b/examples/todomvc/src/todomvc/core.cljs @@ -14,6 +14,13 @@ :initialize (fn [db _] + (dispatch [:add-todo "Rename Cloact to Reagent"]) + (dispatch [:add-todo "Add undo demo"]) + (dispatch [:add-todo "Make all rendering async"]) + (dispatch [:add-todo "Allow any arguments to component functions"]) + (dispatch [:add-todo "Use re-frame in the todomvc example"]) + (dispatch [:complete-all true]) + ;; as the dispatches are async the next line is executed first (merge db initial-db))) (register-pure-handler @@ -98,15 +105,9 @@ (reaction (- (count @(subscribe [:items])) @(subscribe [:done]))))) -(dispatch [:initialize]) -(defonce init (do - (dispatch [:add-todo "Rename Cloact to Reagent"]) - (dispatch [:add-todo "Add undo demo"]) - (dispatch [:add-todo "Make all rendering async"]) - (dispatch [:add-todo "Allow any arguments to component functions"]) - (dispatch [:add-todo "Use re-frame in the todomvc example"]) - (dispatch [:complete-all true]))) + +(defonce init (dispatch [:initialize])) (defn todo-input [{:keys [title on-save on-stop]}] (let [val (atom title)