bhauman / devcards

Devcards aims to provide a visual REPL experience for ClojureScript
1.53k stars 116 forks source link

Added DataScript rendering support #97

Closed alexandergunnarson closed 1 year ago

alexandergunnarson commented 8 years ago
alexandergunnarson commented 8 years ago

@bhauman ,

@Conaws (Conor White-Sullivan) reached out to you on Twitter a few weeks back (his handle there is @Conaw) and talked about possibly doing a pull request to support DataScript rendering. Here it is.

The description and documentation I provided in the pull request is pretty self-explanatory, but do let me know if you have any questions.

Thanks! Devcards is awesome!

bhauman commented 8 years ago

Hey,

Could you call this data-render-fn and have it return the rendered react elements. (i.e. don't pass the result to edn-rend/html-edn). This would be much more general.

Thanks!!

ClashTheBunny commented 5 years ago

It seems that this PR can be replaced by just using projection:

:projection
(fn
  [db]
  (->> db
       (map (fn [d] {:e     (:e     d)
                     :a     (:a     d)
                     :v     (:v     d)
                     :tx    (:tx    d)
                     :added (:added d)}))))

Would we be able to either close this or to start a library of functions that work as projections? I didn't see a bunch of documentation on projection other than a simple example. Either way, I'm up for giving this a go.

bhauman commented 5 years ago

I think starting a library of projections makes a lot of sense.