Open
Description
Problem statement:
I have a list of items that I want to output in a table. Before each item, I want to output the rank of the item:
| 1 | First item |
| 2 | Second item |
To do this I use code along these lines:
(om/build-all display-row rows {:key :id})
Looking at the source-code,
I see that build-all
uses map
with an index (why not map-indexed?),
but that index (::index
) is lost on the way down to my display-row
function.
The only way I've managed to get a hold of the index is by the way of the following code:
(aget (aget owner "props") "__om_index")
which seems a bit hackish to me.
Proposed solution:
Add a :index
keyword to the opts
map for a component which contains the current index if the component is built using build-all
Metadata
Metadata
Assignees
Labels
No labels