generator.client.pagination.secondary.rest-page.md Maven / Gradle / Ivy
# Rest Page
Used to map from Rest model to Domain model
Usage:
```typescript
export class MyRepo {
// constructor
list(): Promise> {
return this.rest.get>('/api/domain-object').then(toPage(toDomainObject));
}
}
type RestDomainObject = {
id: string;
};
const toDomainObject = (rest: RestDomainObject): DomainObject => ({
id: rest.id,
});
```