devcards

Devcards aims to provide a visual REPL experience for ClojureScript https://github.com/bhauman/devcards
kauko 2016-06-21T04:49:00.000033Z

Hmm, I tested in the REPL and both Carry's EntangledReference and Lentes' lenses do satisfy that

kauko 2016-06-21T13:12:33.000034Z

Validating the card options doesn't use atom-like, it checks to see if the initial data is an atom (or vector, or a map)

(defn validate-card-options [opts]
  (if (map? opts)
    ...
                  (or (nil? initial-data)
                      (vector? initial-data)
                      (map? initial-data)
                      (satisfies? IAtom initial-data)
                      {:label :initial-data
                       :message "should be an Atom or a Map or nil."
                       :value initial-data})]
                 ...

kauko 2016-06-21T13:14:52.000035Z

I guess we could add something like writable-atom-like? and readable-atom-like?, and when the options are validated, only require that the data be a writable thing if history is true in the options

kauko 2016-06-21T13:15:03.000036Z

otherwise it's enough if its readable

bhauman 2016-06-21T13:31:45.000037Z

its probably enough to make it in but time travel won't work, look for swap! and reset! to see when writable is needed

bhauman 2016-06-21T13:32:07.000038Z

@kauko: ^

bhauman 2016-06-21T13:33:04.000039Z

and atom-like? should definitely work in place of (satisfies? IAtom initial-data)

bhauman 2016-06-21T13:33:20.000040Z

thats a welcome patch