[Package] React-List-Container: a paginated list package for React and Meteor


#1

Something that’s common to nearly every Meteor app out there is paginated lists. But they can be quite a pain to set up, especially if you’re not comfortable with template-level subscriptions.

So this package provides a React container that fetches your data, and then passes it on to a child component as props:

Features include:

  • Server-side pagination
  • Joins support (generated automatically from your collection schema)
  • Trees (the container can nest your data into a tree, useful for displaying nested comments for example)
  • An ItemContainer for displaying single documents.

It’s still a work in progress, but I think it can already be pretty useful!


#2

How much does this align with what @tmeasday has written about in the guide:

I’d suggest that if it doesn’t then we should fix one or the other! I’m diving into GraphQL right now and pagination seems to be an open question over there as well, with different options along the complexity-performance-features triangle.


#3

It aligns pretty well I think. But I’m happy to tweak it if need be. For example, I’m not using the find from publication package yet.

And regarding GraphQL, I haven’t looked too much into it yet but my thinking was that people could use this container for now, and then once Apollo is officially out they can just swap the container out for its GraphQL equivalent without having to change the rest of their app.


#4

Yeah I’m just highlighting that pagination is a pretty complicated topic!


#5

This is great.

I add an issue on the repo related to API improvements.


#6

Can i use this with connect?


#7

Can you expand your question a bit further - how would you like to use it with connect? This is a Meteor package, tied pretty closely to Meteor’s data handling model. Meteor leverages connect behind the scenes, but this package relies on a lot of Meteor’s layers built outside of / on top of connect.