re-frame-10x
re-frame-10x copied to clipboard
Provide more useful information in data browser
The data browser is great at looking at data in app-db, subs, and the new code tracing feature. It does well at not overwhelming you with too much data, by hiding more data behind the disclosure triangle. But sometimes the specifics of the data are not as interesting as the next level of structure, or the way that the data is printed obscures the difference between different things. Some useful things to be able to see/say about data are:
- "There are 65 elements in this vector"
- "The keys in this map are
:x,:y,:z - "The shape of the data provided matches this spec"
- "The shape of this data is a {:x [100 items] :y boolean :z String}"
- "The keys of this map are
(1 3 4 5 6 7 10) - "The first 5 and last 5 elements of this vector are: `
As a concrete example:
- The first two
todosare maps with 5 elements in them, with keys(3 4 5 6 7) (vals todos) returned a sequence of 5 maps(filter :done)returned a sequence 2 maps(map :id)returned a sequence of 2 integers(reduce dissoc todos)returned a map with 3 map entries in them, with keys(3 6 7)