(extend-vector-like cls {:keys [read write] :as opts})
sets the fields of an object with keyword
(extend-vector-like test.Cat {:read (fn [x] (seq (.getName x))) :write (fn [arr] (test.Cat. (apply str arr)))})
(test.Cat. "spike") ;=> #test.Cat(\s \p \i \k \e)
sets the fields of an object with keyword (extend-vector-like test.Cat {:read (fn [x] (seq (.getName x))) :write (fn [arr] (test.Cat. (apply str arr)))}) (test.Cat. "spike") ;=> #test.Cat(\s \p \i \k \e)
cljdoc builds & hosts documentation for Clojure/Script libraries
Ctrl+k | Jump to recent docs |
← | Move to previous article |
→ | Move to next article |
Ctrl+/ | Jump to the search field |