Created
June 13, 2016 16:32
-
-
Save dbazile/6f0f014c3fa413eb2341eeb98fdcea6f to your computer and use it in GitHub Desktop.
Because looking it up every time is a PITA
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export function paginate({startIndex, count, totalCount}) { | |
return { | |
page: Math.ceil(startIndex / count), | |
pages: Math.ceil(totalCount / count) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment