Skip to content

Commit

Permalink
feat: add clone for Paginator
Browse files Browse the repository at this point in the history
Calling `next` will mutation the paginator, so I want to avoid this.
Then clone the paginator is necessary.
  • Loading branch information
sxzz committed Jan 9, 2023
1 parent fbfd515 commit 0c74998
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/paginator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,9 @@ export class Paginator<Entity, Params = never>

return path;
};

clone(): Paginator<Entity, Params> {
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
return new Paginator(this.http, this.nextPath!, this.nextParams);
}
}

0 comments on commit 0c74998

Please sign in to comment.