Skip to content

Commit

Permalink
feat(peopleadapter): create an interface
Browse files Browse the repository at this point in the history
  • Loading branch information
akoushke committed Aug 8, 2019
1 parent 3530d99 commit 3756f53
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/adapters/PeopleAdapter.js
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'));
}
}

0 comments on commit 3756f53

Please sign in to comment.