MatrixAI / js-pagination

Pagination library that supports Offset and Cursor based pagination
https://matrix.ai
Apache License 2.0
0 stars 0 forks source link

Dealing with Loose Monotonicity #13

Open CMCDragonkai opened 3 years ago

CMCDragonkai commented 3 years ago

Assuming strict monotonicity seems quite limiting as it means the backend has to be much more complex.

Can we change pagination to support loose monotonicity, so that the display order is not entirely consistent but at least we don't potential items that have the same seek value.

In this case we probably cannot use exclusive comparison operators. But this also means pagination will return repeated values, and the FE will need to throw away values it has already seen before somehow.

CMCDragonkai commented 3 years ago

2 options for strict monotonicity

  1. Use a serial auto increment id that is GUARANTEED to be monotonic
  2. Actually figure out how to acquire a monotonic time stamp from the OS
CMCDragonkai commented 3 years ago

These resources are relevant: