{"action":"created","comment":{"url":"https://api.github.com/repos/sharapinski/angular-program/pulls/comments/171164140","pull_request_review_id":99967271,"id":171164140,"diff_hunk":"@@ -0,0 +1,47 @@\n+import { Action } from '@ngrx/store';\n+import { Course } from './course';\n+\n+export enum CourseListActionTypes {\n+  GETLIST = 'getlist',\n+  INIT = 'init'\n+}\n+\n+export class Init implements Action {\n+  readonly type = CourseListActionTypes.INIT;\n+}\n+\n+export class GetList implements Action {\n+  readonly type = CourseListActionTypes.GETLIST;\n+\n+  constructor(public payload: any) {}\n+}\n+\n+export type CourseListActions = Init | GetList;\n+\n+export interface State {\n+  courses: Course[],\n+  // searchValue: string,\n+  page: {current: number, total: number}\n+}\n+\n+export const initialState: State = {\n+  courses: [],\n+  // searchValue:  '',\n+  page: {current: 0, total: 0}\n+};\n+\n+export function courseListReducer(state: State = initialState, action: CourseListActions): State {\n+  switch(action.type) {\n+    case CourseListActionTypes.GETLIST:\n+      const res = action.payload\n+      let page = res.facets && res.facets.pages ? res.facets.pages: null;\n+      let list = res.courses ? res.courses.filter(item => new Date(item.date).getTime() > new Date().getTime() - 14 * 24 * 60 * 60 * 1000): [];","path":"src/app/shared/course.reducer.ts","position":38,"original_position":38,"commit_id":"e252b987c505d5efb46e3267940761bbd9565886","original_commit_id":"e252b987c505d5efb46e3267940761bbd9565886","user":{"login":"Antontelesh","id":3889580,"avatar_url":"https://avatars3.githubusercontent.com/u/3889580?v=4","gravatar_id":"","url":"https://api.github.com/users/Antontelesh","html_url":"https://github.com/Antontelesh","followers_url":"https://api.github.com/users/Antontelesh/followers","following_url":"https://api.github.com/users/Antontelesh/following{/other_user}","gists_url":"https://api.github.com/users/Antontelesh/gists{/gist_id}","starred_url":"https://api.github.com/users/Antontelesh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Antontelesh/subscriptions","organizations_url":"https://api.github.com/users/Antontelesh/orgs","repos_url":"https://api.github.com/users/Antontelesh/repos","events_url":"https://api.github.com/users/Antontelesh/events{/privacy}","received_events_url":"https://api.github.com/users/Antontelesh/received_events","type":"User","site_admin":false},"body":"It's a good practice to keep your reducers pure. Depending on outer world like `new Date` makes them impure and hardly possible to cover with tests in the future.","created_at":"2018-02-28T07:52:56Z","updated_at":"2018-02-28T07:53:22Z","html_url":"https://github.com/sharapinski/angular-program/pull/12#discussion_r171164140","pull_request_url":"https://api.github.com/repos/sharapinski/angular-program/pulls/12","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/sharapinski/angular-program/pulls/comments/171164140"},"html":{"href":"https://github.com/sharapinski/angular-program/pull/12#discussion_r171164140"},"pull_request":{"href":"https://api.github.com/repos/sharapinski/angular-program/pulls/12"}}},"pull_request":{"url":"https://api.github.com/repos/sharapinski/angular-program/pulls/12","id":171532825,"html_url":"https://github.com/sharapinski/angular-program/pull/12","diff_url":"https://github.com/sharapinski/angular-program/pull/12.diff","patch_url":"https://github.com/sharapinski/angular-program/pull/12.patch","issue_url":"https://api.github.com/repos/sharapinski/angular-program/issues/12","number":12,"state":"open","locked":false,"title":"Week11hw10","user":{"login":"sharapinski","id":7988390,"avatar_url":"https://avatars2.githubusercontent.com/u/7988390?v=4","gravatar_id":"","url":"https://api.github.com/users/sharapinski","html_url":"https://github.com/sharapinski","followers_url":"https://api.github.com/users/sharapinski/followers","following_url":"https://api.github.com/users/sharapinski/following{/other_user}","gists_url":"https://api.github.com/users/sharapinski/gists{/gist_id}","starred_url":"https://api.github.com/users/sharapinski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sharapinski/subscriptions","organizations_url":"https://api.github.com/users/sharapinski/orgs","repos_url":"https://api.github.com/users/sharapinski/repos","events_url":"https://api.github.com/users/sharapinski/events{/privacy}","received_events_url":"https://api.github.com/users/sharapinski/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-02-27T00:40:49Z","updated_at":"2018-02-28T07:53:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"af637748c28d41a59b817a1224ca4d623788bef7","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/sharapinski/angular-program/pulls/12/commits","review_comments_url":"https://api.github.com/repos/sharapinski/angular-program/pulls/12/comments","review_comment_url":"https://api.github.com/repos/sharapinski/angular-program/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sharapinski/angular-program/issues/12/comments","statuses_url":"https://api.github.com/repos/sharapinski/angular-program/statuses/e252b987c505d5efb46e3267940761bbd9565886","head":{"label":"sharapinski:week11hw10","ref":"week11hw10","sha":"e252b987c505d5efb46e3267940761bbd9565886","user":{"login":"sharapinski","id":7988390,"avatar_url":"https://avatars2.githubusercontent.com/u/7988390?v=4","gravatar_id":"","url":"https://api.github.com/users/sharapinski","html_url":"https://github.com/sharapinski","followers_url":"https://api.github.com/users/sharapinski/followers","following_url":"https://api.github.com/users/sharapinski/following{/other_user}","gists_url":"https://api.github.com/users/sharapinski/gists{/gist_id}","starred_url":"https://api.github.com/users/sharapinski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sharapinski/subscriptions","organizations_url":"https://api.github.com/users/sharapinski/orgs","repos_url":"https://api.github.com/users/sharapinski/repos","events_url":"https://api.github.com/users/sharapinski/events{/privacy}","received_events_url":"https://api.github.com/users/sharapinski/received_events","type":"User","site_admin":false},"repo":{"id":112121770,"name":"angular-program","full_name":"sharapinski/angular-program","owner":{"login":"sharapinski","id":7988390,"avatar_url":"https://avatars2.githubusercontent.com/u/7988390?v=4","gravatar_id":"","url":"https://api.github.com/users/sharapinski","html_url":"https://github.com/sharapinski","followers_url":"https://api.github.com/users/sharapinski/followers","following_url":"https://api.github.com/users/sharapinski/following{/other_user}","gists_url":"https://api.github.com/users/sharapinski/gists{/gist_id}","starred_url":"https://api.github.com/users/sharapinski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sharapinski/subscriptions","organizations_url":"https://api.github.com/users/sharapinski/orgs","repos_url":"https://api.github.com/users/sharapinski/repos","events_url":"https://api.github.com/users/sharapinski/events{/privacy}","received_events_url":"https://api.github.com/users/sharapinski/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sharapinski/angular-program","description":"Angular Mentoring Program","fork":false,"url":"https://api.github.com/repos/sharapinski/angular-program","forks_url":"https://api.github.com/repos/sharapinski/angular-program/forks","keys_url":"https://api.github.com/repos/sharapinski/angular-program/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sharapinski/angular-program/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sharapinski/angular-program/teams","hooks_url":"https://api.github.com/repos/sharapinski/angular-program/hooks","issue_events_url":"https://api.github.com/repos/sharapinski/angular-program/issues/events{/number}","events_url":"https://api.github.com/repos/sharapinski/angular-program/events","assignees_url":"https://api.github.com/repos/sharapinski/angular-program/assignees{/user}","branches_url":"https://api.github.com/repos/sharapinski/angular-program/branches{/branch}","tags_url":"https://api.github.com/repos/sharapinski/angular-program/tags","blobs_url":"https://api.github.com/repos/sharapinski/angular-program/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sharapinski/angular-program/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sharapinski/angular-program/git/refs{/sha}","trees_url":"https://api.github.com/repos/sharapinski/angular-program/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sharapinski/angular-program/statuses/{sha}","languages_url":"https://api.github.com/repos/sharapinski/angular-program/languages","stargazers_url":"https://api.github.com/repos/sharapinski/angular-program/stargazers","contributors_url":"https://api.github.com/repos/sharapinski/angular-program/contributors","subscribers_url":"https://api.github.com/repos/sharapinski/angular-program/subscribers","subscription_url":"https://api.github.com/repos/sharapinski/angular-program/subscription","commits_url":"https://api.github.com/repos/sharapinski/angular-program/commits{/sha}","git_commits_url":"https://api.github.com/repos/sharapinski/angular-program/git/commits{/sha}","comments_url":"https://api.github.com/repos/sharapinski/angular-program/comments{/number}","issue_comment_url":"https://api.github.com/repos/sharapinski/angular-program/issues/comments{/number}","contents_url":"https://api.github.com/repos/sharapinski/angular-program/contents/{+path}","compare_url":"https://api.github.com/repos/sharapinski/angular-program/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sharapinski/angular-program/merges","archive_url":"https://api.github.com/repos/sharapinski/angular-program/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sharapinski/angular-program/downloads","issues_url":"https://api.github.com/repos/sharapinski/angular-program/issues{/number}","pulls_url":"https://api.github.com/repos/sharapinski/angular-program/pulls{/number}","milestones_url":"https://api.github.com/repos/sharapinski/angular-program/milestones{/number}","notifications_url":"https://api.github.com/repos/sharapinski/angular-program/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sharapinski/angular-program/labels{/name}","releases_url":"https://api.github.com/repos/sharapinski/angular-program/releases{/id}","deployments_url":"https://api.github.com/repos/sharapinski/angular-program/deployments","created_at":"2017-11-26T22:27:30Z","updated_at":"2017-11-30T08:27:00Z","pushed_at":"2018-02-27T00:40:49Z","git_url":"git://github.com/sharapinski/angular-program.git","ssh_url":"git@github.com:sharapinski/angular-program.git","clone_url":"https://github.com/sharapinski/angular-program.git","svn_url":"https://github.com/sharapinski/angular-program","homepage":null,"size":293,"stargazers_count":0,"watchers_count":0,"language":"TypeScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"sharapinski:master","ref":"master","sha":"c293568c675224b53dbc3059cd329e66e88c0bd3","user":{"login":"sharapinski","id":7988390,"avatar_url":"https://avatars2.githubusercontent.com/u/7988390?v=4","gravatar_id":"","url":"https://api.github.com/users/sharapinski","html_url":"https://github.com/sharapinski","followers_url":"https://api.github.com/users/sharapinski/followers","following_url":"https://api.github.com/users/sharapinski/following{/other_user}","gists_url":"https://api.github.com/users/sharapinski/gists{/gist_id}","starred_url":"https://api.github.com/users/sharapinski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sharapinski/subscriptions","organizations_url":"https://api.github.com/users/sharapinski/orgs","repos_url":"https://api.github.com/users/sharapinski/repos","events_url":"https://api.github.com/users/sharapinski/events{/privacy}","received_events_url":"https://api.github.com/users/sharapinski/received_events","type":"User","site_admin":false},"repo":{"id":112121770,"name":"angular-program","full_name":"sharapinski/angular-program","owner":{"login":"sharapinski","id":7988390,"avatar_url":"https://avatars2.githubusercontent.com/u/7988390?v=4","gravatar_id":"","url":"https://api.github.com/users/sharapinski","html_url":"https://github.com/sharapinski","followers_url":"https://api.github.com/users/sharapinski/followers","following_url":"https://api.github.com/users/sharapinski/following{/other_user}","gists_url":"https://api.github.com/users/sharapinski/gists{/gist_id}","starred_url":"https://api.github.com/users/sharapinski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sharapinski/subscriptions","organizations_url":"https://api.github.com/users/sharapinski/orgs","repos_url":"https://api.github.com/users/sharapinski/repos","events_url":"https://api.github.com/users/sharapinski/events{/privacy}","received_events_url":"https://api.github.com/users/sharapinski/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sharapinski/angular-program","description":"Angular Mentoring Program","fork":false,"url":"https://api.github.com/repos/sharapinski/angular-program","forks_url":"https://api.github.com/repos/sharapinski/angular-program/forks","keys_url":"https://api.github.com/repos/sharapinski/angular-program/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sharapinski/angular-program/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sharapinski/angular-program/teams","hooks_url":"https://api.github.com/repos/sharapinski/angular-program/hooks","issue_events_url":"https://api.github.com/repos/sharapinski/angular-program/issues/events{/number}","events_url":"https://api.github.com/repos/sharapinski/angular-program/events","assignees_url":"https://api.github.com/repos/sharapinski/angular-program/assignees{/user}","branches_url":"https://api.github.com/repos/sharapinski/angular-program/branches{/branch}","tags_url":"https://api.github.com/repos/sharapinski/angular-program/tags","blobs_url":"https://api.github.com/repos/sharapinski/angular-program/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sharapinski/angular-program/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sharapinski/angular-program/git/refs{/sha}","trees_url":"https://api.github.com/repos/sharapinski/angular-program/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sharapinski/angular-program/statuses/{sha}","languages_url":"https://api.github.com/repos/sharapinski/angular-program/languages","stargazers_url":"https://api.github.com/repos/sharapinski/angular-program/stargazers","contributors_url":"https://api.github.com/repos/sharapinski/angular-program/contributors","subscribers_url":"https://api.github.com/repos/sharapinski/angular-program/subscribers","subscription_url":"https://api.github.com/repos/sharapinski/angular-program/subscription","commits_url":"https://api.github.com/repos/sharapinski/angular-program/commits{/sha}","git_commits_url":"https://api.github.com/repos/sharapinski/angular-program/git/commits{/sha}","comments_url":"https://api.github.com/repos/sharapinski/angular-program/comments{/number}","issue_comment_url":"https://api.github.com/repos/sharapinski/angular-program/issues/comments{/number}","contents_url":"https://api.github.com/repos/sharapinski/angular-program/contents/{+path}","compare_url":"https://api.github.com/repos/sharapinski/angular-program/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sharapinski/angular-program/merges","archive_url":"https://api.github.com/repos/sharapinski/angular-program/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sharapinski/angular-program/downloads","issues_url":"https://api.github.com/repos/sharapinski/angular-program/issues{/number}","pulls_url":"https://api.github.com/repos/sharapinski/angular-program/pulls{/number}","milestones_url":"https://api.github.com/repos/sharapinski/angular-program/milestones{/number}","notifications_url":"https://api.github.com/repos/sharapinski/angular-program/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sharapinski/angular-program/labels{/name}","releases_url":"https://api.github.com/repos/sharapinski/angular-program/releases{/id}","deployments_url":"https://api.github.com/repos/sharapinski/angular-program/deployments","created_at":"2017-11-26T22:27:30Z","updated_at":"2017-11-30T08:27:00Z","pushed_at":"2018-02-27T00:40:49Z","git_url":"git://github.com/sharapinski/angular-program.git","ssh_url":"git@github.com:sharapinski/angular-program.git","clone_url":"https://github.com/sharapinski/angular-program.git","svn_url":"https://github.com/sharapinski/angular-program","homepage":null,"size":293,"stargazers_count":0,"watchers_count":0,"language":"TypeScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/sharapinski/angular-program/pulls/12"},"html":{"href":"https://github.com/sharapinski/angular-program/pull/12"},"issue":{"href":"https://api.github.com/repos/sharapinski/angular-program/issues/12"},"comments":{"href":"https://api.github.com/repos/sharapinski/angular-program/issues/12/comments"},"review_comments":{"href":"https://api.github.com/repos/sharapinski/angular-program/pulls/12/comments"},"review_comment":{"href":"https://api.github.com/repos/sharapinski/angular-program/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sharapinski/angular-program/pulls/12/commits"},"statuses":{"href":"https://api.github.com/repos/sharapinski/angular-program/statuses/e252b987c505d5efb46e3267940761bbd9565886"}},"author_association":"OWNER"}}
{"actor":{"display_login":"Antontelesh"}}