Skip to content

Instantly share code, notes, and snippets.

@optii
Created July 17, 2019 12:23
Show Gist options
  • Save optii/b13e1d543b43ca0e2b8b3a218ea7c8d7 to your computer and use it in GitHub Desktop.
Save optii/b13e1d543b43ca0e2b8b3a218ea7c8d7 to your computer and use it in GitHub Desktop.
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