Created
July 17, 2019 12:23
-
-
Save optii/b13e1d543b43ca0e2b8b3a218ea7c8d7 to your computer and use it in GitHub Desktop.
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
const generator = (model) => { | |
return class extends model { | |
static get QueryBuilder() { | |
return class SearchQueryBuilder extends objectionModel.QueryBuilder { | |
constructor(modelClass) { | |
super(modelClass); | |
} | |
paginate(params = { page: 1, perPage: 10}){ | |
// DO YOU LOGIC TO PAGINATE | |
} | |
} | |
} | |
} | |
} | |
generator(userModel); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment