{"action":"created","comment":{"url":"https://api.github.com/repos/csula-students/cs-3220-spring-2018-arodr856/pulls/comments/175000754","pull_request_review_id":104458162,"id":175000754,"diff_hunk":"@@ -0,0 +1,47 @@\n+import Generator from \"./models/generator\";\n+import Story from \"./models/story\";\n+import constants from \"./constants\";\n+\n+export default function reducer (state, action) {\n+ switch (action.type) {\n+     case constants.actions.EXAMPLE:\n+         state.example = action.payload;\n+         return state;\n+\n+     case constants.actions.BUY_GENERATOR:\n+         state.generators.forEach(generator => {\n+            if(generator.name === action.payload.name){\n+               let genModel = new Generator(generator);\n+               let generatorCost = genModel.getCost(); \n+               if(generatorCost <= state.counter){ \n+                  state.counter -= generatorCost.toFixed(2); \n+                  generator.quantity++;\n+                  generator.unlockValue = genModel.getCost();\n+                }\n+                return state;\n+            }\n+        });\n+        return state;\t\n+\n+     case constants.actions.INCREMENT:\n+         state.counter += action.payload;\n+         return state;\n+\n+     case constants.actions.CHECK_STORY:\n+         state.stories.forEach(story => {\n+           let storyModel = new Story(story);\n+           if (storyModel.isUnlockYet(state.counter)){\n+              storyModel.unlock();\n+              story.state = storyModel.state;\n+            }\n+            else{\n+              \n+              story.state = 'hidden';\n+            }","path":"homework01/client/src/reducer.js","position":40,"original_position":40,"commit_id":"3e2f08044ca20368842643b49d400ebce45bf4ee","original_commit_id":"3e2f08044ca20368842643b49d400ebce45bf4ee","user":{"login":"rcliao","id":2566047,"avatar_url":"https://avatars1.githubusercontent.com/u/2566047?v=4","gravatar_id":"","url":"https://api.github.com/users/rcliao","html_url":"https://github.com/rcliao","followers_url":"https://api.github.com/users/rcliao/followers","following_url":"https://api.github.com/users/rcliao/following{/other_user}","gists_url":"https://api.github.com/users/rcliao/gists{/gist_id}","starred_url":"https://api.github.com/users/rcliao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rcliao/subscriptions","organizations_url":"https://api.github.com/users/rcliao/orgs","repos_url":"https://api.github.com/users/rcliao/repos","events_url":"https://api.github.com/users/rcliao/events{/privacy}","received_events_url":"https://api.github.com/users/rcliao/received_events","type":"User","site_admin":false},"body":"you don't need to hide the story once it's shown.","created_at":"2018-03-16T05:29:59Z","updated_at":"2018-03-16T05:30:41Z","html_url":"https://github.com/csula-students/cs-3220-spring-2018-arodr856/pull/5#discussion_r175000754","pull_request_url":"https://api.github.com/repos/csula-students/cs-3220-spring-2018-arodr856/pulls/5","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/csula-students/cs-3220-spring-2018-arodr856/pulls/comments/175000754"},"html":{"href":"https://github.com/csula-students/cs-3220-spring-2018-arodr856/pull/5#discussion_r175000754"},"pull_request":{"href":"https://api.github.com/repos/csula-students/cs-3220-spring-2018-arodr856/pulls/5"}}},"pull_request":{"url":"https://api.github.com/repos/csula-students/cs-3220-spring-2018-arodr856/pulls/5","id":173943719,"html_url":"https://github.com/csula-students/cs-3220-spring-2018-arodr856/pull/5","diff_url":"https://github.com/csula-students/cs-3220-spring-2018-arodr856/pull/5.diff","patch_url":"https://github.com/csula-students/cs-3220-spring-2018-arodr856/pull/5.patch","issue_url":"https://api.github.com/repos/csula-students/cs-3220-spring-2018-arodr856/issues/5","number":5,"state":"closed","locked":false,"title":"Homework01","user":{"login":"arodr856","id":29101191,"avatar_url":"https://avatars2.githubusercontent.com/u/29101191?v=4","gravatar_id":"","url":"https://api.github.com/users/arodr856","html_url":"https://github.com/arodr856","followers_url":"https://api.github.com/users/arodr856/followers","following_url":"https://api.github.com/users/arodr856/following{/other_user}","gists_url":"https://api.github.com/users/arodr856/gists{/gist_id}","starred_url":"https://api.github.com/users/arodr856/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arodr856/subscriptions","organizations_url":"https://api.github.com/users/arodr856/orgs","repos_url":"https://api.github.com/users/arodr856/repos","events_url":"https://api.github.com/users/arodr856/events{/privacy}","received_events_url":"https://api.github.com/users/arodr856/received_events","type":"User","site_admin":false},"body":"Homework01","created_at":"2018-03-09T08:14:15Z","updated_at":"2018-03-16T05:30:41Z","closed_at":"2018-03-13T17:09:14Z","merged_at":"2018-03-13T17:09:14Z","merge_commit_sha":"fab0533f35018da6513765ef7c8ca1283092932e","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/csula-students/cs-3220-spring-2018-arodr856/pulls/5/commits","review_comments_url":"https://api.github.com/repos/csula-students/cs-3220-spring-2018-arodr856/pulls/5/comments","review_comment_url":"https://api.github.com/repos/csula-students/cs-3220-spring-2018-arodr856/pulls/comments{/number}","comments_url":"https://api.github.com/repos/csula-students/cs-3220-spring-2018-arodr856/issues/5/comments","statuses_url":"https://api.github.com/repos/csula-students/cs-3220-spring-2018-arodr856/statuses/3e2f08044ca20368842643b49d400ebce45bf4ee","head":{"label":"csula-students:homework01","ref":"homework01","sha":"3e2f08044ca20368842643b49d400ebce45bf4ee","user":{"login":"csula-students","id":18237553,"avatar_url":"https://avatars3.githubusercontent.com/u/18237553?v=4","gravatar_id":"","url":"https://api.github.com/users/csula-students","html_url":"https://github.com/csula-students","followers_url":"https://api.github.com/users/csula-students/followers","following_url":"https://api.github.com/users/csula-students/following{/other_user}","gists_url":"https://api.github.com/users/csula-students/gists{/gist_id}","starred_url":"https://api.github.com/users/csula-students/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/csula-students/subscriptions","organizations_url":"https://api.github.com/users/csula-students/orgs","repos_url":"https://api.github.com/users/csula-students/repos","events_url":"https://api.github.com/users/csula-students/events{/privacy}","received_events_url":"https://api.github.com/users/csula-students/received_events","type":"Organization","site_admin":false},"repo":{"id":119219416,"name":"cs-3220-spring-2018-arodr856","full_name":"csula-students/cs-3220-spring-2018-arodr856","owner":{"login":"csula-students","id":18237553,"avatar_url":"https://avatars3.githubusercontent.com/u/18237553?v=4","gravatar_id":"","url":"https://api.github.com/users/csula-students","html_url":"https://github.com/csula-students","followers_url":"https://api.github.com/users/csula-students/followers","following_url":"https://api.github.com/users/csula-students/following{/other_user}","gists_url":"https://api.github.com/users/csula-students/gists{/gist_id}","starred_url":"https://api.github.com/users/csula-students/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/csula-students/subscriptions","organizations_url":"https://api.github.com/users/csula-students/orgs","repos_url":"https://api.github.com/users/csula-students/repos","events_url":"https://api.github.com/users/csula-students/events{/privacy}","received_events_url":"https://api.github.com/users/csula-students/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/csula-students/cs-3220-spring-2018-arodr856","description":"cs-3220-spring-2018-arodr856 created by GitHub Classroom","fork":false,"url":"https://api.github.com/repos/csula-students/cs-3220-spring-2018-arodr856","forks_url":"https://api.github.com/repos/csula-students/cs-3220-spring-2018-arodr856/forks","keys_url":"https://api.github.com/repos/csula-students/cs-3220-spring-2018-arodr856/keys{/key_id}","collaborators_url":"https://api.github.com/repos/csula-students/cs-3220-spring-2018-arodr856/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/csula-students/cs-3220-spring-2018-arodr856/teams","hooks_url":"https://api.github.com/repos/csula-students/cs-3220-spring-2018-arodr856/hooks","issue_events_url":"https://api.github.com/repos/csula-students/cs-3220-spring-2018-arodr856/issues/events{/number}","events_url":"https://api.github.com/repos/csula-students/cs-3220-spring-2018-arodr856/events","assignees_url":"https://api.github.com/repos/csula-students/cs-3220-spring-2018-arodr856/assignees{/user}","branches_url":"https://api.github.com/repos/csula-students/cs-3220-spring-2018-arodr856/branches{/branch}","tags_url":"https://api.github.com/repos/csula-students/cs-3220-spring-2018-arodr856/tags","blobs_url":"https://api.github.com/repos/csula-students/cs-3220-spring-2018-arodr856/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/csula-students/cs-3220-spring-2018-arodr856/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/csula-students/cs-3220-spring-2018-arodr856/git/refs{/sha}","trees_url":"https://api.github.com/repos/csula-students/cs-3220-spring-2018-arodr856/git/trees{/sha}","statuses_url":"https://api.github.com/repos/csula-students/cs-3220-spring-2018-arodr856/statuses/{sha}","languages_url":"https://api.github.com/repos/csula-students/cs-3220-spring-2018-arodr856/languages","stargazers_url":"https://api.github.com/repos/csula-students/cs-3220-spring-2018-arodr856/stargazers","contributors_url":"https://api.github.com/repos/csula-students/cs-3220-spring-2018-arodr856/contributors","subscribers_url":"https://api.github.com/repos/csula-students/cs-3220-spring-2018-arodr856/subscribers","subscription_url":"https://api.github.com/repos/csula-students/cs-3220-spring-2018-arodr856/subscription","commits_url":"https://api.github.com/repos/csula-students/cs-3220-spring-2018-arodr856/commits{/sha}","git_commits_url":"https://api.github.com/repos/csula-students/cs-3220-spring-2018-arodr856/git/commits{/sha}","comments_url":"https://api.github.com/repos/csula-students/cs-3220-spring-2018-arodr856/comments{/number}","issue_comment_url":"https://api.github.com/repos/csula-students/cs-3220-spring-2018-arodr856/issues/comments{/number}","contents_url":"https://api.github.com/repos/csula-students/cs-3220-spring-2018-arodr856/contents/{+path}","compare_url":"https://api.github.com/repos/csula-students/cs-3220-spring-2018-arodr856/compare/{base}...{head}","merges_url":"https://api.github.com/repos/csula-students/cs-3220-spring-2018-arodr856/merges","archive_url":"https://api.github.com/repos/csula-students/cs-3220-spring-2018-arodr856/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/csula-students/cs-3220-spring-2018-arodr856/downloads","issues_url":"https://api.github.com/repos/csula-students/cs-3220-spring-2018-arodr856/issues{/number}","pulls_url":"https://api.github.com/repos/csula-students/cs-3220-spring-2018-arodr856/pulls{/number}","milestones_url":"https://api.github.com/repos/csula-students/cs-3220-spring-2018-arodr856/milestones{/number}","notifications_url":"https://api.github.com/repos/csula-students/cs-3220-spring-2018-arodr856/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/csula-students/cs-3220-spring-2018-arodr856/labels{/name}","releases_url":"https://api.github.com/repos/csula-students/cs-3220-spring-2018-arodr856/releases{/id}","deployments_url":"https://api.github.com/repos/csula-students/cs-3220-spring-2018-arodr856/deployments","created_at":"2018-01-28T02:01:42Z","updated_at":"2018-03-13T17:09:17Z","pushed_at":"2018-03-13T17:09:15Z","git_url":"git://github.com/csula-students/cs-3220-spring-2018-arodr856.git","ssh_url":"git@github.com:csula-students/cs-3220-spring-2018-arodr856.git","clone_url":"https://github.com/csula-students/cs-3220-spring-2018-arodr856.git","svn_url":"https://github.com/csula-students/cs-3220-spring-2018-arodr856","homepage":null,"size":12089,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"csula-students:master","ref":"master","sha":"52742cafadd1d85366b38adc9d8117253d23f8d6","user":{"login":"csula-students","id":18237553,"avatar_url":"https://avatars3.githubusercontent.com/u/18237553?v=4","gravatar_id":"","url":"https://api.github.com/users/csula-students","html_url":"https://github.com/csula-students","followers_url":"https://api.github.com/users/csula-students/followers","following_url":"https://api.github.com/users/csula-students/following{/other_user}","gists_url":"https://api.github.com/users/csula-students/gists{/gist_id}","starred_url":"https://api.github.com/users/csula-students/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/csula-students/subscriptions","organizations_url":"https://api.github.com/users/csula-students/orgs","repos_url":"https://api.github.com/users/csula-students/repos","events_url":"https://api.github.com/users/csula-students/events{/privacy}","received_events_url":"https://api.github.com/users/csula-students/received_events","type":"Organization","site_admin":false},"repo":{"id":119219416,"name":"cs-3220-spring-2018-arodr856","full_name":"csula-students/cs-3220-spring-2018-arodr856","owner":{"login":"csula-students","id":18237553,"avatar_url":"https://avatars3.githubusercontent.com/u/18237553?v=4","gravatar_id":"","url":"https://api.github.com/users/csula-students","html_url":"https://github.com/csula-students","followers_url":"https://api.github.com/users/csula-students/followers","following_url":"https://api.github.com/users/csula-students/following{/other_user}","gists_url":"https://api.github.com/users/csula-students/gists{/gist_id}","starred_url":"https://api.github.com/users/csula-students/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/csula-students/subscriptions","organizations_url":"https://api.github.com/users/csula-students/orgs","repos_url":"https://api.github.com/users/csula-students/repos","events_url":"https://api.github.com/users/csula-students/events{/privacy}","received_events_url":"https://api.github.com/users/csula-students/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/csula-students/cs-3220-spring-2018-arodr856","description":"cs-3220-spring-2018-arodr856 created by GitHub Classroom","fork":false,"url":"https://api.github.com/repos/csula-students/cs-3220-spring-2018-arodr856","forks_url":"https://api.github.com/repos/csula-students/cs-3220-spring-2018-arodr856/forks","keys_url":"https://api.github.com/repos/csula-students/cs-3220-spring-2018-arodr856/keys{/key_id}","collaborators_url":"https://api.github.com/repos/csula-students/cs-3220-spring-2018-arodr856/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/csula-students/cs-3220-spring-2018-arodr856/teams","hooks_url":"https://api.github.com/repos/csula-students/cs-3220-spring-2018-arodr856/hooks","issue_events_url":"https://api.github.com/repos/csula-students/cs-3220-spring-2018-arodr856/issues/events{/number}","events_url":"https://api.github.com/repos/csula-students/cs-3220-spring-2018-arodr856/events","assignees_url":"https://api.github.com/repos/csula-students/cs-3220-spring-2018-arodr856/assignees{/user}","branches_url":"https://api.github.com/repos/csula-students/cs-3220-spring-2018-arodr856/branches{/branch}","tags_url":"https://api.github.com/repos/csula-students/cs-3220-spring-2018-arodr856/tags","blobs_url":"https://api.github.com/repos/csula-students/cs-3220-spring-2018-arodr856/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/csula-students/cs-3220-spring-2018-arodr856/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/csula-students/cs-3220-spring-2018-arodr856/git/refs{/sha}","trees_url":"https://api.github.com/repos/csula-students/cs-3220-spring-2018-arodr856/git/trees{/sha}","statuses_url":"https://api.github.com/repos/csula-students/cs-3220-spring-2018-arodr856/statuses/{sha}","languages_url":"https://api.github.com/repos/csula-students/cs-3220-spring-2018-arodr856/languages","stargazers_url":"https://api.github.com/repos/csula-students/cs-3220-spring-2018-arodr856/stargazers","contributors_url":"https://api.github.com/repos/csula-students/cs-3220-spring-2018-arodr856/contributors","subscribers_url":"https://api.github.com/repos/csula-students/cs-3220-spring-2018-arodr856/subscribers","subscription_url":"https://api.github.com/repos/csula-students/cs-3220-spring-2018-arodr856/subscription","commits_url":"https://api.github.com/repos/csula-students/cs-3220-spring-2018-arodr856/commits{/sha}","git_commits_url":"https://api.github.com/repos/csula-students/cs-3220-spring-2018-arodr856/git/commits{/sha}","comments_url":"https://api.github.com/repos/csula-students/cs-3220-spring-2018-arodr856/comments{/number}","issue_comment_url":"https://api.github.com/repos/csula-students/cs-3220-spring-2018-arodr856/issues/comments{/number}","contents_url":"https://api.github.com/repos/csula-students/cs-3220-spring-2018-arodr856/contents/{+path}","compare_url":"https://api.github.com/repos/csula-students/cs-3220-spring-2018-arodr856/compare/{base}...{head}","merges_url":"https://api.github.com/repos/csula-students/cs-3220-spring-2018-arodr856/merges","archive_url":"https://api.github.com/repos/csula-students/cs-3220-spring-2018-arodr856/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/csula-students/cs-3220-spring-2018-arodr856/downloads","issues_url":"https://api.github.com/repos/csula-students/cs-3220-spring-2018-arodr856/issues{/number}","pulls_url":"https://api.github.com/repos/csula-students/cs-3220-spring-2018-arodr856/pulls{/number}","milestones_url":"https://api.github.com/repos/csula-students/cs-3220-spring-2018-arodr856/milestones{/number}","notifications_url":"https://api.github.com/repos/csula-students/cs-3220-spring-2018-arodr856/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/csula-students/cs-3220-spring-2018-arodr856/labels{/name}","releases_url":"https://api.github.com/repos/csula-students/cs-3220-spring-2018-arodr856/releases{/id}","deployments_url":"https://api.github.com/repos/csula-students/cs-3220-spring-2018-arodr856/deployments","created_at":"2018-01-28T02:01:42Z","updated_at":"2018-03-13T17:09:17Z","pushed_at":"2018-03-13T17:09:15Z","git_url":"git://github.com/csula-students/cs-3220-spring-2018-arodr856.git","ssh_url":"git@github.com:csula-students/cs-3220-spring-2018-arodr856.git","clone_url":"https://github.com/csula-students/cs-3220-spring-2018-arodr856.git","svn_url":"https://github.com/csula-students/cs-3220-spring-2018-arodr856","homepage":null,"size":12089,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/csula-students/cs-3220-spring-2018-arodr856/pulls/5"},"html":{"href":"https://github.com/csula-students/cs-3220-spring-2018-arodr856/pull/5"},"issue":{"href":"https://api.github.com/repos/csula-students/cs-3220-spring-2018-arodr856/issues/5"},"comments":{"href":"https://api.github.com/repos/csula-students/cs-3220-spring-2018-arodr856/issues/5/comments"},"review_comments":{"href":"https://api.github.com/repos/csula-students/cs-3220-spring-2018-arodr856/pulls/5/comments"},"review_comment":{"href":"https://api.github.com/repos/csula-students/cs-3220-spring-2018-arodr856/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/csula-students/cs-3220-spring-2018-arodr856/pulls/5/commits"},"statuses":{"href":"https://api.github.com/repos/csula-students/cs-3220-spring-2018-arodr856/statuses/3e2f08044ca20368842643b49d400ebce45bf4ee"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"rcliao"}}