2 ms·
Nice examples. Am I correct in guessing that this code: (ns com.stuartsierra.component (:require [com.stuartsierra.dependency :as dep] [c
by jfaucett 11y ago
Nice examples. Am I correct in guessing that this code:
(ns com.stuartsierra.component
(:require [com.stuartsierra.dependency :as dep]
[com.stuartsierra.component.platform :as platform]))
requires the correct platform.clj or platform.cljs depending on the runtime?
And that this:
#?(:clj
(defmethod clojure.core/print-method SystemMap
[system ^java.io.Writer writer]
(.write writer "#<SystemMap>"))
:cljs
(extend-protocol IPrintWithWriter
SystemMap
(-pr-writer [this writer opts]
(-write writer "#<SystemMap>"))))
is how you perform different operations in a single file based on runtime?
- 147 11y agoThe first part requires platform on both platforms. You are correct about the latter.