Permalink
Browse files

💪 `@phenomic/core`: `previousPageIsFirst` now always return a value (…

…`false` instead of `undefined`)

This is to make Reasonml usage easier.
  • Loading branch information...
MoOx committed Jan 11, 2018
1 parent 69361b8 commit e12b53d464c005e8bf44d66a58099f886870aff8
Showing with 1 addition and 1 deletion.
  1. +1 −1 packages/core/src/api/index.js
@@ -10,7 +10,7 @@ export const decode = (text: string) => new Buffer(text, "base64").toString();
const connect = (list, limit, previousList = []) => {
const hasNextPage = limit === undefined ? false : list.length > limit;
const hasPreviousPage = previousList.length > 0;
const previousPageIsFirst = limit ? previousList.length <= limit : undefined;
const previousPageIsFirst = limit ? previousList.length <= limit : false;
// we are retrieving limit + 1 to know if there is more page or not
// so when getting the previous item, we need to check if we want the last
// item or the one before (since we added one to the limit)

0 comments on commit e12b53d

Please sign in to comment.