{"action":"created","comment":{"url":"https://api.github.com/repos/sergeitoptalo/nodejs-mentoring/pulls/comments/243015700","pull_request_review_id":186672891,"id":243015700,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI0MzAxNTcwMA==","diff_hunk":"@@ -0,0 +1,97 @@\n+import EventEmitter from 'events';\n+import fs from 'fs';\n+import { IDirWatcherState, IFileState } from './models/DirWatcherState';\n+import { compareStates } from './utilities/stateComparison';\n+\n+export default class DirWatcher extends EventEmitter {\n+    private state: IDirWatcherState;\n+\n+    constructor() {\n+        super();\n+        this.state = {\n+            delay: 0,\n+            folderContent: {\n+                fileNames: [],\n+                files: [],\n+            },\n+            path: '',\n+            timers: [],\n+        };\n+    }\n+\n+    public watch(path: string, delay: number) {\n+        this.state.path = path;\n+        this.state.delay = delay;\n+        setInterval(() => {\n+            this.detectChanges();\n+        }, this.state.delay);\n+    }\n+\n+    private readDirectory() {\n+        return new Promise((resolve, reject) => {","path":"src/DirWatcher/DirWatcher.ts","position":31,"original_position":31,"commit_id":"efaecbe8f6bfcc75327ec2e32c29c57c69c24577","original_commit_id":"efaecbe8f6bfcc75327ec2e32c29c57c69c24577","user":{"login":"sergeitoptalo","id":5205362,"node_id":"MDQ6VXNlcjUyMDUzNjI=","avatar_url":"https://avatars0.githubusercontent.com/u/5205362?v=4","gravatar_id":"","url":"https://api.github.com/users/sergeitoptalo","html_url":"https://github.com/sergeitoptalo","followers_url":"https://api.github.com/users/sergeitoptalo/followers","following_url":"https://api.github.com/users/sergeitoptalo/following{/other_user}","gists_url":"https://api.github.com/users/sergeitoptalo/gists{/gist_id}","starred_url":"https://api.github.com/users/sergeitoptalo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sergeitoptalo/subscriptions","organizations_url":"https://api.github.com/users/sergeitoptalo/orgs","repos_url":"https://api.github.com/users/sergeitoptalo/repos","events_url":"https://api.github.com/users/sergeitoptalo/events{/privacy}","received_events_url":"https://api.github.com/users/sergeitoptalo/received_events","type":"User","site_admin":false},"body":"Fixed","created_at":"2018-12-19T17:54:18Z","updated_at":"2018-12-19T17:54:19Z","html_url":"https://github.com/sergeitoptalo/nodejs-mentoring/pull/2#discussion_r243015700","pull_request_url":"https://api.github.com/repos/sergeitoptalo/nodejs-mentoring/pulls/2","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/sergeitoptalo/nodejs-mentoring/pulls/comments/243015700"},"html":{"href":"https://github.com/sergeitoptalo/nodejs-mentoring/pull/2#discussion_r243015700"},"pull_request":{"href":"https://api.github.com/repos/sergeitoptalo/nodejs-mentoring/pulls/2"}},"in_reply_to_id":242814630},"pull_request":{"url":"https://api.github.com/repos/sergeitoptalo/nodejs-mentoring/pulls/2","id":238061755,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM4MDYxNzU1","html_url":"https://github.com/sergeitoptalo/nodejs-mentoring/pull/2","diff_url":"https://github.com/sergeitoptalo/nodejs-mentoring/pull/2.diff","patch_url":"https://github.com/sergeitoptalo/nodejs-mentoring/pull/2.patch","issue_url":"https://api.github.com/repos/sergeitoptalo/nodejs-mentoring/issues/2","number":2,"state":"open","locked":false,"title":"Homework 02","user":{"login":"sergeitoptalo","id":5205362,"node_id":"MDQ6VXNlcjUyMDUzNjI=","avatar_url":"https://avatars0.githubusercontent.com/u/5205362?v=4","gravatar_id":"","url":"https://api.github.com/users/sergeitoptalo","html_url":"https://github.com/sergeitoptalo","followers_url":"https://api.github.com/users/sergeitoptalo/followers","following_url":"https://api.github.com/users/sergeitoptalo/following{/other_user}","gists_url":"https://api.github.com/users/sergeitoptalo/gists{/gist_id}","starred_url":"https://api.github.com/users/sergeitoptalo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sergeitoptalo/subscriptions","organizations_url":"https://api.github.com/users/sergeitoptalo/orgs","repos_url":"https://api.github.com/users/sergeitoptalo/repos","events_url":"https://api.github.com/users/sergeitoptalo/events{/privacy}","received_events_url":"https://api.github.com/users/sergeitoptalo/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-12-12T14:43:32Z","updated_at":"2018-12-19T17:54:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"13aaf89182853ead6facc5c3781988a57eff2abb","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/sergeitoptalo/nodejs-mentoring/pulls/2/commits","review_comments_url":"https://api.github.com/repos/sergeitoptalo/nodejs-mentoring/pulls/2/comments","review_comment_url":"https://api.github.com/repos/sergeitoptalo/nodejs-mentoring/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sergeitoptalo/nodejs-mentoring/issues/2/comments","statuses_url":"https://api.github.com/repos/sergeitoptalo/nodejs-mentoring/statuses/efaecbe8f6bfcc75327ec2e32c29c57c69c24577","head":{"label":"sergeitoptalo:homework-02","ref":"homework-02","sha":"efaecbe8f6bfcc75327ec2e32c29c57c69c24577","user":{"login":"sergeitoptalo","id":5205362,"node_id":"MDQ6VXNlcjUyMDUzNjI=","avatar_url":"https://avatars0.githubusercontent.com/u/5205362?v=4","gravatar_id":"","url":"https://api.github.com/users/sergeitoptalo","html_url":"https://github.com/sergeitoptalo","followers_url":"https://api.github.com/users/sergeitoptalo/followers","following_url":"https://api.github.com/users/sergeitoptalo/following{/other_user}","gists_url":"https://api.github.com/users/sergeitoptalo/gists{/gist_id}","starred_url":"https://api.github.com/users/sergeitoptalo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sergeitoptalo/subscriptions","organizations_url":"https://api.github.com/users/sergeitoptalo/orgs","repos_url":"https://api.github.com/users/sergeitoptalo/repos","events_url":"https://api.github.com/users/sergeitoptalo/events{/privacy}","received_events_url":"https://api.github.com/users/sergeitoptalo/received_events","type":"User","site_admin":false},"repo":{"id":157692430,"node_id":"MDEwOlJlcG9zaXRvcnkxNTc2OTI0MzA=","name":"nodejs-mentoring","full_name":"sergeitoptalo/nodejs-mentoring","private":false,"owner":{"login":"sergeitoptalo","id":5205362,"node_id":"MDQ6VXNlcjUyMDUzNjI=","avatar_url":"https://avatars0.githubusercontent.com/u/5205362?v=4","gravatar_id":"","url":"https://api.github.com/users/sergeitoptalo","html_url":"https://github.com/sergeitoptalo","followers_url":"https://api.github.com/users/sergeitoptalo/followers","following_url":"https://api.github.com/users/sergeitoptalo/following{/other_user}","gists_url":"https://api.github.com/users/sergeitoptalo/gists{/gist_id}","starred_url":"https://api.github.com/users/sergeitoptalo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sergeitoptalo/subscriptions","organizations_url":"https://api.github.com/users/sergeitoptalo/orgs","repos_url":"https://api.github.com/users/sergeitoptalo/repos","events_url":"https://api.github.com/users/sergeitoptalo/events{/privacy}","received_events_url":"https://api.github.com/users/sergeitoptalo/received_events","type":"User","site_admin":false},"html_url":"https://github.com/sergeitoptalo/nodejs-mentoring","description":null,"fork":false,"url":"https://api.github.com/repos/sergeitoptalo/nodejs-mentoring","forks_url":"https://api.github.com/repos/sergeitoptalo/nodejs-mentoring/forks","keys_url":"https://api.github.com/repos/sergeitoptalo/nodejs-mentoring/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sergeitoptalo/nodejs-mentoring/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sergeitoptalo/nodejs-mentoring/teams","hooks_url":"https://api.github.com/repos/sergeitoptalo/nodejs-mentoring/hooks","issue_events_url":"https://api.github.com/repos/sergeitoptalo/nodejs-mentoring/issues/events{/number}","events_url":"https://api.github.com/repos/sergeitoptalo/nodejs-mentoring/events","assignees_url":"https://api.github.com/repos/sergeitoptalo/nodejs-mentoring/assignees{/user}","branches_url":"https://api.github.com/repos/sergeitoptalo/nodejs-mentoring/branches{/branch}","tags_url":"https://api.github.com/repos/sergeitoptalo/nodejs-mentoring/tags","blobs_url":"https://api.github.com/repos/sergeitoptalo/nodejs-mentoring/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sergeitoptalo/nodejs-mentoring/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sergeitoptalo/nodejs-mentoring/git/refs{/sha}","trees_url":"https://api.github.com/repos/sergeitoptalo/nodejs-mentoring/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sergeitoptalo/nodejs-mentoring/statuses/{sha}","languages_url":"https://api.github.com/repos/sergeitoptalo/nodejs-mentoring/languages","stargazers_url":"https://api.github.com/repos/sergeitoptalo/nodejs-mentoring/stargazers","contributors_url":"https://api.github.com/repos/sergeitoptalo/nodejs-mentoring/contributors","subscribers_url":"https://api.github.com/repos/sergeitoptalo/nodejs-mentoring/subscribers","subscription_url":"https://api.github.com/repos/sergeitoptalo/nodejs-mentoring/subscription","commits_url":"https://api.github.com/repos/sergeitoptalo/nodejs-mentoring/commits{/sha}","git_commits_url":"https://api.github.com/repos/sergeitoptalo/nodejs-mentoring/git/commits{/sha}","comments_url":"https://api.github.com/repos/sergeitoptalo/nodejs-mentoring/comments{/number}","issue_comment_url":"https://api.github.com/repos/sergeitoptalo/nodejs-mentoring/issues/comments{/number}","contents_url":"https://api.github.com/repos/sergeitoptalo/nodejs-mentoring/contents/{+path}","compare_url":"https://api.github.com/repos/sergeitoptalo/nodejs-mentoring/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sergeitoptalo/nodejs-mentoring/merges","archive_url":"https://api.github.com/repos/sergeitoptalo/nodejs-mentoring/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sergeitoptalo/nodejs-mentoring/downloads","issues_url":"https://api.github.com/repos/sergeitoptalo/nodejs-mentoring/issues{/number}","pulls_url":"https://api.github.com/repos/sergeitoptalo/nodejs-mentoring/pulls{/number}","milestones_url":"https://api.github.com/repos/sergeitoptalo/nodejs-mentoring/milestones{/number}","notifications_url":"https://api.github.com/repos/sergeitoptalo/nodejs-mentoring/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sergeitoptalo/nodejs-mentoring/labels{/name}","releases_url":"https://api.github.com/repos/sergeitoptalo/nodejs-mentoring/releases{/id}","deployments_url":"https://api.github.com/repos/sergeitoptalo/nodejs-mentoring/deployments","created_at":"2018-11-15T10:20:28Z","updated_at":"2018-12-06T14:50:44Z","pushed_at":"2018-12-16T16:24:59Z","git_url":"git://github.com/sergeitoptalo/nodejs-mentoring.git","ssh_url":"git@github.com:sergeitoptalo/nodejs-mentoring.git","clone_url":"https://github.com/sergeitoptalo/nodejs-mentoring.git","svn_url":"https://github.com/sergeitoptalo/nodejs-mentoring","homepage":null,"size":30,"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":"sergeitoptalo:master","ref":"master","sha":"78d6dc90e9ab94ed31d2af2f396e255077f4efde","user":{"login":"sergeitoptalo","id":5205362,"node_id":"MDQ6VXNlcjUyMDUzNjI=","avatar_url":"https://avatars0.githubusercontent.com/u/5205362?v=4","gravatar_id":"","url":"https://api.github.com/users/sergeitoptalo","html_url":"https://github.com/sergeitoptalo","followers_url":"https://api.github.com/users/sergeitoptalo/followers","following_url":"https://api.github.com/users/sergeitoptalo/following{/other_user}","gists_url":"https://api.github.com/users/sergeitoptalo/gists{/gist_id}","starred_url":"https://api.github.com/users/sergeitoptalo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sergeitoptalo/subscriptions","organizations_url":"https://api.github.com/users/sergeitoptalo/orgs","repos_url":"https://api.github.com/users/sergeitoptalo/repos","events_url":"https://api.github.com/users/sergeitoptalo/events{/privacy}","received_events_url":"https://api.github.com/users/sergeitoptalo/received_events","type":"User","site_admin":false},"repo":{"id":157692430,"node_id":"MDEwOlJlcG9zaXRvcnkxNTc2OTI0MzA=","name":"nodejs-mentoring","full_name":"sergeitoptalo/nodejs-mentoring","private":false,"owner":{"login":"sergeitoptalo","id":5205362,"node_id":"MDQ6VXNlcjUyMDUzNjI=","avatar_url":"https://avatars0.githubusercontent.com/u/5205362?v=4","gravatar_id":"","url":"https://api.github.com/users/sergeitoptalo","html_url":"https://github.com/sergeitoptalo","followers_url":"https://api.github.com/users/sergeitoptalo/followers","following_url":"https://api.github.com/users/sergeitoptalo/following{/other_user}","gists_url":"https://api.github.com/users/sergeitoptalo/gists{/gist_id}","starred_url":"https://api.github.com/users/sergeitoptalo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sergeitoptalo/subscriptions","organizations_url":"https://api.github.com/users/sergeitoptalo/orgs","repos_url":"https://api.github.com/users/sergeitoptalo/repos","events_url":"https://api.github.com/users/sergeitoptalo/events{/privacy}","received_events_url":"https://api.github.com/users/sergeitoptalo/received_events","type":"User","site_admin":false},"html_url":"https://github.com/sergeitoptalo/nodejs-mentoring","description":null,"fork":false,"url":"https://api.github.com/repos/sergeitoptalo/nodejs-mentoring","forks_url":"https://api.github.com/repos/sergeitoptalo/nodejs-mentoring/forks","keys_url":"https://api.github.com/repos/sergeitoptalo/nodejs-mentoring/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sergeitoptalo/nodejs-mentoring/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sergeitoptalo/nodejs-mentoring/teams","hooks_url":"https://api.github.com/repos/sergeitoptalo/nodejs-mentoring/hooks","issue_events_url":"https://api.github.com/repos/sergeitoptalo/nodejs-mentoring/issues/events{/number}","events_url":"https://api.github.com/repos/sergeitoptalo/nodejs-mentoring/events","assignees_url":"https://api.github.com/repos/sergeitoptalo/nodejs-mentoring/assignees{/user}","branches_url":"https://api.github.com/repos/sergeitoptalo/nodejs-mentoring/branches{/branch}","tags_url":"https://api.github.com/repos/sergeitoptalo/nodejs-mentoring/tags","blobs_url":"https://api.github.com/repos/sergeitoptalo/nodejs-mentoring/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sergeitoptalo/nodejs-mentoring/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sergeitoptalo/nodejs-mentoring/git/refs{/sha}","trees_url":"https://api.github.com/repos/sergeitoptalo/nodejs-mentoring/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sergeitoptalo/nodejs-mentoring/statuses/{sha}","languages_url":"https://api.github.com/repos/sergeitoptalo/nodejs-mentoring/languages","stargazers_url":"https://api.github.com/repos/sergeitoptalo/nodejs-mentoring/stargazers","contributors_url":"https://api.github.com/repos/sergeitoptalo/nodejs-mentoring/contributors","subscribers_url":"https://api.github.com/repos/sergeitoptalo/nodejs-mentoring/subscribers","subscription_url":"https://api.github.com/repos/sergeitoptalo/nodejs-mentoring/subscription","commits_url":"https://api.github.com/repos/sergeitoptalo/nodejs-mentoring/commits{/sha}","git_commits_url":"https://api.github.com/repos/sergeitoptalo/nodejs-mentoring/git/commits{/sha}","comments_url":"https://api.github.com/repos/sergeitoptalo/nodejs-mentoring/comments{/number}","issue_comment_url":"https://api.github.com/repos/sergeitoptalo/nodejs-mentoring/issues/comments{/number}","contents_url":"https://api.github.com/repos/sergeitoptalo/nodejs-mentoring/contents/{+path}","compare_url":"https://api.github.com/repos/sergeitoptalo/nodejs-mentoring/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sergeitoptalo/nodejs-mentoring/merges","archive_url":"https://api.github.com/repos/sergeitoptalo/nodejs-mentoring/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sergeitoptalo/nodejs-mentoring/downloads","issues_url":"https://api.github.com/repos/sergeitoptalo/nodejs-mentoring/issues{/number}","pulls_url":"https://api.github.com/repos/sergeitoptalo/nodejs-mentoring/pulls{/number}","milestones_url":"https://api.github.com/repos/sergeitoptalo/nodejs-mentoring/milestones{/number}","notifications_url":"https://api.github.com/repos/sergeitoptalo/nodejs-mentoring/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sergeitoptalo/nodejs-mentoring/labels{/name}","releases_url":"https://api.github.com/repos/sergeitoptalo/nodejs-mentoring/releases{/id}","deployments_url":"https://api.github.com/repos/sergeitoptalo/nodejs-mentoring/deployments","created_at":"2018-11-15T10:20:28Z","updated_at":"2018-12-06T14:50:44Z","pushed_at":"2018-12-16T16:24:59Z","git_url":"git://github.com/sergeitoptalo/nodejs-mentoring.git","ssh_url":"git@github.com:sergeitoptalo/nodejs-mentoring.git","clone_url":"https://github.com/sergeitoptalo/nodejs-mentoring.git","svn_url":"https://github.com/sergeitoptalo/nodejs-mentoring","homepage":null,"size":30,"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/sergeitoptalo/nodejs-mentoring/pulls/2"},"html":{"href":"https://github.com/sergeitoptalo/nodejs-mentoring/pull/2"},"issue":{"href":"https://api.github.com/repos/sergeitoptalo/nodejs-mentoring/issues/2"},"comments":{"href":"https://api.github.com/repos/sergeitoptalo/nodejs-mentoring/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/sergeitoptalo/nodejs-mentoring/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/sergeitoptalo/nodejs-mentoring/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sergeitoptalo/nodejs-mentoring/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/sergeitoptalo/nodejs-mentoring/statuses/efaecbe8f6bfcc75327ec2e32c29c57c69c24577"}},"author_association":"OWNER"}}
{"actor":{"display_login":"sergeitoptalo"}}