Skip to content

Instantly share code, notes, and snippets.

@darwin

darwin/rep.cljs Secret

Created Jun 3, 2016
Embed
What would you like to do?
; example rep
;
;{:tag "div",
; :class "widget vbox",
; :children
; ({:tag "div",
; :class "list-item selected",
; :children
; ({:tag "div",
; :class "subtitle",
; :content "core.cljs:10",
; :title
; "http://localhost:9080/compiled/tests/dirac/tests/scenarios/breakpoint/core.cljs:10"}
; {:tag "div",
; :class "title",
; :content "breakpoint-demo",
; :title
; "dirac.tests.scenarios.breakpoint.core/breakpoint-demo"})}
; {:tag "div",
; :class "list-item",
; :children
; ({:tag "div",
; :class "subtitle",
; :content "notifications.cljs:48",
; :title
; "http://localhost:9080/compiled/tests/dirac/automation/notifications.cljs:48"}
; {:tag "div",
; :class "title",
; :content "process-notification!",
; :title
; "dirac.automation.notifications/process-notification!"})}
; {:tag "div",
; :class "list-item",
; :children
; ({:tag "div",
; :class "subtitle",
; :content "notifications.cljs:53",
; :title
; "http://localhost:9080/compiled/tests/dirac/automation/notifications.cljs:53"}
; {:tag "div",
; :class "title",
; :content "process-event!",
; :title "dirac.automation.notifications/process-event!"})})}
(declarepath TreeWalker)
(providepath TreeWalker
(if-path map?
[:children ALL TreeWalker]
STAY))
(defn want? [rep]
(log "?" rep)
(= (:class rep) "title"))
(defn filter-rep [rep]
(select [TreeWalker want?] rep))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment