MCPcopy Create free account
hub / github.com/ThatGuySam/doesitarm / constructor

Method constructor

helpers/api/pagination.js:5–14  ·  view source on GitHub ↗
({ list, perPage = defaultPerPage })

Source from the content-addressed store, hash-verified

3
4export class PaginatedList {
5 constructor({ list, perPage = defaultPerPage }) {
6
7 // Catch errors if the list is not an array or a function
8 if ( !Array.isArray( list ) && typeof list !== 'function' ) {
9 throw new Error(`List must be an array or a function but is ${typeof list}`)
10 }
11
12 this.listArg = list
13 this.perPage = perPage
14 }
15
16 get list () {
17 // if our list is a function, call it

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected