Skip to content

Commit

Permalink
registry/add! now just takes a map with sketch-id
Browse files Browse the repository at this point in the history
  • Loading branch information
dgtized committed Jul 10, 2024
1 parent bc59553 commit cdbf8a0
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 22 deletions.
4 changes: 2 additions & 2 deletions src/shimmers/registry.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@

(def sketches (atom {}))

(defn add! [name sketch]
(swap! sketches assoc name sketch))
(defn add! [sketch]
(swap! sketches assoc (:sketch-id sketch) sketch))
40 changes: 20 additions & 20 deletions src/shimmers/sketch.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -87,16 +87,16 @@

(let [page-identifier# ~(keyword sketch-page-name)
m# (meta (var ~sketch-page-name))]
(registry/add! page-identifier#
{:sketch-id page-identifier#
:type :quil
:fn ~runner
:taps ~(:taps options)
:created-at ~(:created-at opts)
:tags ~(:tags opts #{})
:ns (:ns m#)
:file (:file m#)
:line (:line m#)})))))
(registry/add!
{:sketch-id page-identifier#
:type :quil
:fn ~runner
:taps ~(:taps options)
:created-at ~(:created-at opts)
:tags ~(:tags opts #{})
:ns (:ns m#)
:file (:file m#)
:line (:line m#)})))))


;; `component` is a macro specifically to allow repl changes to
Expand All @@ -122,16 +122,16 @@

(let [page-identifier# ~(keyword sketch-page-name)
m# (meta (var ~sketch-page-name))]
(registry/add! page-identifier#
{:sketch-id page-identifier#
:type ~(:type options)
:fn ~runner
:taps ~(:taps options)
:created-at ~created-at
:tags ~(:tags options #{})
:ns (:ns m#)
:file (:file m#)
:line (:line m#)})))))
(registry/add!
{:sketch-id page-identifier#
:type ~(:type options)
:fn ~runner
:taps ~(:taps options)
:created-at ~created-at
:tags ~(:tags options #{})
:ns (:ns m#)
:file (:file m#)
:line (:line m#)})))))

(defn with-explanation
[component & children]
Expand Down

0 comments on commit cdbf8a0

Please sign in to comment.