Skip to content

Instantly share code, notes, and snippets.

@darwin

darwin/rep.cljs Secret

Created June 3, 2016 13:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save darwin/9a2673fdb2448132c6d1908195df0932 to your computer and use it in GitHub Desktop.
Save darwin/9a2673fdb2448132c6d1908195df0932 to your computer and use it in GitHub Desktop.
; 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