shoebox icon indicating copy to clipboard operation
shoebox copied to clipboard

How to get the OrderedViewSet from Shoebox<T>?

Open marad opened this issue 5 years ago • 1 comments

In an example I can see that we can get the OrderedViewSet by grouping the items in some way. What if I would like to display all the lists? I can't find any way to do renderEach on the lists Shoebox.

marad avatar May 24 '20 07:05 marad

Shoebox could use a better way to do this, but for now something like this should work (I haven't tested this code):

    val lists = Shoebox<List>(dir.resolve("lists"))
    val allLists = lists.view("allLists", {true})
                          .orderedSet(true, compareBy(List::uid))
   renderEach(allLists) { list ->
    // ...
   }

This would not work well if there were a large number of lists, but then that would be an issue regardless.

sanity avatar May 24 '20 15:05 sanity