diff options
author | crupest <crupest@outlook.com> | 2019-04-13 13:03:18 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2019-04-13 13:03:18 +0800 |
commit | fac5006e7eaf7f7bc23e92a2b3059d4f1b37fa07 (patch) | |
tree | 39cf181a18a3dc443dbab5669a04d0a23cdefd00 /Timeline/ClientApp/src/app/todo/todo-service/todo.service.ts | |
parent | 8c5e7069d2651fb6fae641dfe482d7a0910b3fd1 (diff) | |
download | timeline-fac5006e7eaf7f7bc23e92a2b3059d4f1b37fa07.tar.gz timeline-fac5006e7eaf7f7bc23e92a2b3059d4f1b37fa07.tar.bz2 timeline-fac5006e7eaf7f7bc23e92a2b3059d4f1b37fa07.zip |
Init separate.
Diffstat (limited to 'Timeline/ClientApp/src/app/todo/todo-service/todo.service.ts')
-rw-r--r-- | Timeline/ClientApp/src/app/todo/todo-service/todo.service.ts | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/Timeline/ClientApp/src/app/todo/todo-service/todo.service.ts b/Timeline/ClientApp/src/app/todo/todo-service/todo.service.ts deleted file mode 100644 index df63636d..00000000 --- a/Timeline/ClientApp/src/app/todo/todo-service/todo.service.ts +++ /dev/null @@ -1,33 +0,0 @@ -import { Injectable } from '@angular/core'; -import { HttpClient } from '@angular/common/http'; -import { Observable, from } from 'rxjs'; -import { switchMap, map, filter } from 'rxjs/operators'; - -import { IssueResponse, githubBaseUrl } from './http-entities'; -import { TodoItem } from '../todo-item'; - - -@Injectable({ - providedIn: 'root' -}) -export class TodoService { - - constructor(private client: HttpClient) { } - - getWorkItemList(): Observable<TodoItem> { - return this.client.get<IssueResponse>(`${githubBaseUrl}/issues`, { - params: { - state: 'all' - } - }).pipe( - switchMap(result => from(result)), - filter(result => result.pull_request === undefined), // filter out pull requests. - map(result => <TodoItem>{ - number: result.number, - title: result.title, - isClosed: result.state === 'closed', - detailUrl: result.html_url - }) - ); - } -} |