-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(peopleadapter): create an interface
- Loading branch information
Showing
1 changed file
with
20 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import {throwError} from 'rxjs'; | ||
|
||
/** | ||
* This is a base class that defines the interface that maps people data. | ||
* Developers that want to extend `PeopleAdapter` must implement all of its methods, | ||
* adhering to the exact parameters and structure of the returned objects | ||
*/ | ||
export default class PeopleAdapter { | ||
/** | ||
* Returns an observable that emits person data | ||
* | ||
* @param {String} id - ID of person to get | ||
* @returns {Observable<PersonObject>} | ||
* @memberof PeopleAdapter | ||
*/ | ||
// eslint-disable-next-line no-unused-vars | ||
getPerson(id) { | ||
return throwError(new Error('getPerson(id) must be defined in PeopleAdapter')); | ||
} | ||
} |