Add tracing config

This commit is contained in:
Daniel Compton 2018-02-09 20:07:10 +13:00
parent e9b679c64a
commit 91030020bb
5 changed files with 42 additions and 17 deletions

View File

@ -0,0 +1 @@
../../../../re-frame-trace/

View File

@ -1,23 +1,27 @@
(defproject todomvc-re-frame "0.10.1"
:dependencies [[org.clojure/clojure "1.8.0"]
:dependencies [[org.clojure/clojure "1.9.0"]
[org.clojure/clojurescript "1.9.908"]
[reagent "0.7.0"]
[re-frame "0.10.1"]
[reagent "0.8.0-alpha2" :exclusions [[cljsjs/react] [cljsjs/react-dom]]]
[cljsjs/react-dom "16.2.0-3"]
[re-frame "0.10.3" :exclusions [reagent]]
[binaryage/devtools "0.9.4"]
[secretary "1.2.3"]]
:plugins [[lein-cljsbuild "1.1.5"]
[lein-figwheel "0.5.13"]]
[lein-figwheel "0.5.15-SNAPSHOT"]]
:hooks [leiningen.cljsbuild]
:profiles {:dev {:cljsbuild
:profiles {:dev {:dependencies [[day8.re-frame/trace "0.1.19-SNAPSHOT"]]
:cljsbuild
{:builds {:client {:compiler {:asset-path "js"
:optimizations :none
:source-map true
:source-map-timestamp true
:main "todomvc.core"}
:main "todomvc.core"
:closure-defines {"re_frame.trace.trace_enabled_QMARK_" true}
:preloads [day8.re-frame.trace.preload]}
:figwheel {:on-jsload "todomvc.core/main"}}}}}
:prod {:cljsbuild
@ -26,11 +30,15 @@
:pretty-print false}}}}}}
:figwheel {:server-port 3450
:repl true}
:repl false}
:clean-targets ^{:protect false} ["resources/public/js" "target"]
:cljsbuild {:builds {:client {:source-paths ["src" "../../src"]
:cljsbuild {:builds {:client {:source-paths ["src" #_ "../../src" "checkouts/re-frame-trace/src"]
:compile-paths ["src"]
:compiler {:output-dir "resources/public/js"
:output-to "resources/public/js/client.js"}}}})
:output-to "resources/public/js/client.js"}}
:dev {:source-paths ["src" #_"../../src" "checkouts/re-frame-trace/src"]
:compiler {:output-dir "resources/public/js1"
:output-to "resources/public/js1/client.js"}}}})

View File

@ -189,3 +189,8 @@
(reduce #(assoc-in %1 [%2 :done] new-done)
todos
(keys todos)))))
(reg-event-db
:other-panel?
(fn [db _]
(update db :other-panel? not)))

View File

@ -162,3 +162,8 @@
:<- [:completed-count]
(fn [[todos completed] _]
[(- (count todos) completed) completed]))
(reg-sub
:other-panel?
(fn [db _]
(:other-panel? db)))

View File

@ -96,11 +96,17 @@
(defn todo-app
[]
[:div
[:section#todoapp
[task-entry]
(when (seq @(subscribe [:todos]))
[task-list])
[footer-controls]]
[:footer#info
[:p "Double-click to edit a todo"]]])
(let [other-panel? @(subscribe [:other-panel?])]
(if other-panel?
[:div
[:h2 "Other panel"]
[:button {:on-click #(dispatch [:other-panel?])} "Switch Panel"]]
[:div
[:button {:on-click #(dispatch [:other-panel?])} "Switch Panel"]
[:section#todoapp
[task-entry]
(when (seq @(subscribe [:todos]))
[task-list])
[footer-controls]]
[:footer#info
[:p "Double-click to edit a todo"]]])))