Skip to content

Commit

Permalink
Get method
Browse files Browse the repository at this point in the history
  • Loading branch information
davguij committed Nov 19, 2017
1 parent 4b3d87c commit 0655e4a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,13 @@ export class rxios {
this._httpClient = axios.create(options);
}

public get<T>(url: string) {
return new Observable<T>(subscriber => {
this._httpClient.get<T>(url).then(response => {
subscriber.next(response.data);
subscriber.complete();
});
});
}

}

0 comments on commit 0655e4a

Please sign in to comment.