Fork me on GitHub
#devcards
<
2016-06-21
>
kauko04:06:00

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

kauko13:06:33

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})]
                 ...

kauko13:06:52

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

kauko13:06:03

otherwise it's enough if its readable

bhauman13:06:45

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

bhauman13:06:04

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

bhauman13:06:20

thats a welcome patch