changed location of initization

This commit is contained in:
Stuart Mitchell 2015-02-26 15:35:01 +13:00
parent 7ba420ee33
commit aa0f9fc4d2
1 changed files with 9 additions and 8 deletions

View File

@ -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)