Skip to content

Instantly share code, notes, and snippets.

View Artesonraju's full-sized avatar

Etienne Molto Artesonraju

View GitHub Profile
@Artesonraju
Artesonraju / pprint-record.cljs
Created September 30, 2018 16:18
Trying to pprint a custom edn record
(defrecord E [])
(extend-protocol IPrintWithWriter E (-pr-writer [this writer _] (write-all writer "#e" (into {} this))))
(def e (map->E {}))
(print e) ; prints #e{}
(pprint e) ; prints {}
@Artesonraju
Artesonraju / sub-stateful.cljs
Last active May 3, 2016 15:19
om.next stateful sub-component to recursive components
(def composite-data
{:composite/item {:id 0
:width 400
:height 400
:color "#428BCA"
:counter {:id 0
:init 0}
:children [{:id 1
:width 200
:height 200
@Artesonraju
Artesonraju / composite.cljs
Last active May 1, 2016 17:44
om.next stateful recursive components
;; =============================================================================
;; Composite
(def composite-data
{:composite/item {:id 0
:width 400
:height 400
:color "#428BCA"
:children [{:id 1
:width 200