Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to get the OrderedViewSet from Shoebox<T>? #10

Open
marad opened this issue May 24, 2020 · 1 comment
Open

How to get the OrderedViewSet from Shoebox<T>? #10

marad opened this issue May 24, 2020 · 1 comment
Labels

Comments

@marad
Copy link
Member

marad commented May 24, 2020

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.

@sanity
Copy link
Member

sanity commented May 24, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants