Calculate count of subscription traces
This commit is contained in:
parent
9454eb1baf
commit
11954d99b1
|
@ -1,9 +1,11 @@
|
||||||
(ns day8.re-frame.trace.preload
|
(ns day8.re-frame.trace.preload
|
||||||
(:require [day8.re-frame.trace :as trace]))
|
(:require [day8.re-frame.trace :as trace]
|
||||||
|
[mranderson047.re-frame.v0v10v2.re-frame.core :as rf]))
|
||||||
|
|
||||||
|
|
||||||
;; Use this namespace with the :preloads compiler option to perform the necessary setup for enabling tracing:
|
;; Use this namespace with the :preloads compiler option to perform the necessary setup for enabling tracing:
|
||||||
;; {:compiler {:preloads [day8.re-frame.trace.preload] ...}}
|
;; {:compiler {:preloads [day8.re-frame.trace.preload] ...}}
|
||||||
|
(rf/clear-subscription-cache!)
|
||||||
(trace/init-db!)
|
(trace/init-db!)
|
||||||
(defonce _ (trace/init-tracing!))
|
(defonce _ (trace/init-tracing!))
|
||||||
(trace/inject-devtools!)
|
(trace/inject-devtools!)
|
||||||
|
|
|
@ -517,32 +517,32 @@
|
||||||
:<- [:subs/visible-subs]
|
:<- [:subs/visible-subs]
|
||||||
(fn [subs _]
|
(fn [subs _]
|
||||||
(->> subs
|
(->> subs
|
||||||
(map :type)
|
(mapcat :order)
|
||||||
(frequencies))))
|
(frequencies))))
|
||||||
|
|
||||||
(rf/reg-sub
|
(rf/reg-sub
|
||||||
:subs/created-count
|
:subs/created-count
|
||||||
:<- [:subs/sub-counts]
|
:<- [:subs/sub-counts]
|
||||||
(fn [counts]
|
(fn [counts]
|
||||||
(get counts :created 0)))
|
(get counts :sub/create 0)))
|
||||||
|
|
||||||
(rf/reg-sub
|
(rf/reg-sub
|
||||||
:subs/re-run-count
|
:subs/re-run-count
|
||||||
:<- [:subs/sub-counts]
|
:<- [:subs/sub-counts]
|
||||||
(fn [counts]
|
(fn [counts]
|
||||||
(get counts :re-run 0)))
|
(get counts :sub/run 0)))
|
||||||
|
|
||||||
(rf/reg-sub
|
(rf/reg-sub
|
||||||
:subs/destroyed-count
|
:subs/destroyed-count
|
||||||
:<- [:subs/sub-counts]
|
:<- [:subs/sub-counts]
|
||||||
(fn [counts]
|
(fn [counts]
|
||||||
(get counts :destroyed 0)))
|
(get counts :sub/dispose 0)))
|
||||||
|
|
||||||
(rf/reg-sub
|
(rf/reg-sub
|
||||||
:subs/not-run-count
|
:subs/not-run-count
|
||||||
:<- [:subs/sub-counts]
|
:<- [:subs/sub-counts]
|
||||||
(fn [counts]
|
(fn [counts]
|
||||||
(get counts :not-run 0)))
|
(get counts :sub/not-run 0)))
|
||||||
|
|
||||||
(rf/reg-sub
|
(rf/reg-sub
|
||||||
:subs/unchanged-l2-subs-count
|
:subs/unchanged-l2-subs-count
|
||||||
|
|
Loading…
Reference in New Issue