bhauman / devcards

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

call function on state displayed by `:inspect-data` info #137

Closed dpsutton closed 5 years ago

dpsutton commented 6 years ago

Love devcards. Wondering about a feature that I think might be pretty easy to accomplish. There is quite a bit of state that is laying around and it would be nice to be able to call a function on this data to narrow it down to just what you might be interested in. For example,

(defcard widget-can-search
  (searcher/PeopleSearcher {:stuff stuff})
  {:search-term "bob"
   :lots-of-extra-stuff [[[[[[[[[[{:a :b}]]]]]]]]]]
   :include-deleted? true}
  {:inspect-data true}
  ;; new part
  (fn [state]
    (select-keys state [:search-term :include-deleted?])))

And I'm just talking about the data displayed underneath the card from :inspect-data. For example, for-example

dpsutton commented 6 years ago

I'm working on doing this and it doesn't seem that bad. Can you tell me how i can get devcards up and running in CIDER though? When i crank up a cljs repl with cider-jack-in-clojurescript, it compiles but i'm unable to get a repl conncted when i go to localhost:3449

dpsutton commented 6 years ago

@bhauman can you make a release to clojars? I see the last snapshot was from Nov 13, 2017 from https://github.com/bhauman/devcards/commit/ae6d1a459b91cfbccb4594c0e6970b2de289a4b3 (according to clojars).

The only reason I'm asking is because I'm already using the feature with a local installed copy. We use datomic and its nice to whittle down the card to the important data and also project out what transaction it would issue based on the current data. Very helpful to keep track of what things look like.

bhauman commented 5 years ago

merged and have released 0.2.6-SNAPSHOT and will release 0.2.6 shortly