{"action":"created","comment":{"url":"https://api.github.com/repos/tinytacoteam/zazu/pulls/comments/72897902","id":72897902,"diff_hunk":"@@ -2,33 +2,80 @@ const EventEmitter = require('events')\n \n const configuration = require('../configuration')\n const Plugin = require('../plugin')\n+const Theme = require('../theme')\n const track = require('../lib/track')\n+const globalEmitter = require('../lib/globalEmitter')\n+const notification = require('../lib/notification')\n \n const CHANGE_RESULTS_EVENT = 'results_change'\n const CHANGE_QUERY_EVENT = 'query_change'\n+const CHANGE_THEME_EVENT = 'theme_change'\n \n class PluginStore extends EventEmitter {\n   constructor () {\n     super()\n     this.query = ''\n     this.results = []\n     this.plugins = []\n+    globalEmitter.on('updatePlugins', () => {\n+      this.update().then(() => {\n+        return this.load()\n+      })\n+    })\n+    this.load()\n   }\n \n   load () {\n     configuration.load()\n-    this.plugins = configuration.plugins.map((plugin) => {\n+    this.loadTheme().then(() => {\n+      return this.loadPlugins()\n+    }).then(() => {\n+      notification.push({\n+        title: 'Plugins loaded',\n+        message: 'Your plugins have been loaded',\n+      })\n+    })\n+  }\n+\n+  loadTheme () {\n+    this.theme = new Theme(configuration.theme, configuration.pluginDir)\n+    return this.theme.load().then((theme) => {\n+      this.emitThemeChange(theme)\n+    })\n+  }\n+\n+  loadPlugins () {\n+    this.plugins = []\n+    return Promise.all(configuration.plugins.map((plugin) => {\n       let pluginObj\n       if (typeof plugin === 'object') {\n         pluginObj = new Plugin(plugin.name, plugin.variables)\n       } else {\n         pluginObj = new Plugin(plugin)\n       }\n-      pluginObj.load()\n-      return pluginObj\n+      this.plugins.push(pluginObj)\n+      return pluginObj.load().then(() => {\n+        track.setAttribute('loadPlugin', pluginObj.id)","path":"app/store/pluginStore.js","position":60,"original_position":60,"commit_id":"dba241d08481b49182e9e4c8f51ae6e4f9ff1f4b","original_commit_id":"dba241d08481b49182e9e4c8f51ae6e4f9ff1f4b","user":{"login":"blainesch","id":769039,"avatar_url":"https://avatars.githubusercontent.com/u/769039?v=3","gravatar_id":"","url":"https://api.github.com/users/blainesch","html_url":"https://github.com/blainesch","followers_url":"https://api.github.com/users/blainesch/followers","following_url":"https://api.github.com/users/blainesch/following{/other_user}","gists_url":"https://api.github.com/users/blainesch/gists{/gist_id}","starred_url":"https://api.github.com/users/blainesch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blainesch/subscriptions","organizations_url":"https://api.github.com/users/blainesch/orgs","repos_url":"https://api.github.com/users/blainesch/repos","events_url":"https://api.github.com/users/blainesch/events{/privacy}","received_events_url":"https://api.github.com/users/blainesch/received_events","type":"User","site_admin":false},"body":"This wil always overwrite the previous value","created_at":"2016-07-31T04:44:29Z","updated_at":"2016-07-31T04:44:29Z","html_url":"https://github.com/tinytacoteam/zazu/pull/43#discussion_r72897902","pull_request_url":"https://api.github.com/repos/tinytacoteam/zazu/pulls/43","_links":{"self":{"href":"https://api.github.com/repos/tinytacoteam/zazu/pulls/comments/72897902"},"html":{"href":"https://github.com/tinytacoteam/zazu/pull/43#discussion_r72897902"},"pull_request":{"href":"https://api.github.com/repos/tinytacoteam/zazu/pulls/43"}}},"pull_request":{"url":"https://api.github.com/repos/tinytacoteam/zazu/pulls/43","id":79476009,"html_url":"https://github.com/tinytacoteam/zazu/pull/43","diff_url":"https://github.com/tinytacoteam/zazu/pull/43.diff","patch_url":"https://github.com/tinytacoteam/zazu/pull/43.patch","issue_url":"https://api.github.com/repos/tinytacoteam/zazu/issues/43","number":43,"state":"open","locked":false,"title":"Give the ability to update the currently installed plugins.","user":{"login":"blainesch","id":769039,"avatar_url":"https://avatars.githubusercontent.com/u/769039?v=3","gravatar_id":"","url":"https://api.github.com/users/blainesch","html_url":"https://github.com/blainesch","followers_url":"https://api.github.com/users/blainesch/followers","following_url":"https://api.github.com/users/blainesch/following{/other_user}","gists_url":"https://api.github.com/users/blainesch/gists{/gist_id}","starred_url":"https://api.github.com/users/blainesch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blainesch/subscriptions","organizations_url":"https://api.github.com/users/blainesch/orgs","repos_url":"https://api.github.com/users/blainesch/repos","events_url":"https://api.github.com/users/blainesch/events{/privacy}","received_events_url":"https://api.github.com/users/blainesch/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-07-31T04:44:05Z","updated_at":"2016-07-31T04:44:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"18c5308028b02829da9e0a3e1e3767c6597c8e07","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/tinytacoteam/zazu/pulls/43/commits","review_comments_url":"https://api.github.com/repos/tinytacoteam/zazu/pulls/43/comments","review_comment_url":"https://api.github.com/repos/tinytacoteam/zazu/pulls/comments{/number}","comments_url":"https://api.github.com/repos/tinytacoteam/zazu/issues/43/comments","statuses_url":"https://api.github.com/repos/tinytacoteam/zazu/statuses/dba241d08481b49182e9e4c8f51ae6e4f9ff1f4b","head":{"label":"tinytacoteam:feature/update","ref":"feature/update","sha":"dba241d08481b49182e9e4c8f51ae6e4f9ff1f4b","user":{"login":"tinytacoteam","id":12994756,"avatar_url":"https://avatars.githubusercontent.com/u/12994756?v=3","gravatar_id":"","url":"https://api.github.com/users/tinytacoteam","html_url":"https://github.com/tinytacoteam","followers_url":"https://api.github.com/users/tinytacoteam/followers","following_url":"https://api.github.com/users/tinytacoteam/following{/other_user}","gists_url":"https://api.github.com/users/tinytacoteam/gists{/gist_id}","starred_url":"https://api.github.com/users/tinytacoteam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tinytacoteam/subscriptions","organizations_url":"https://api.github.com/users/tinytacoteam/orgs","repos_url":"https://api.github.com/users/tinytacoteam/repos","events_url":"https://api.github.com/users/tinytacoteam/events{/privacy}","received_events_url":"https://api.github.com/users/tinytacoteam/received_events","type":"Organization","site_admin":false},"repo":{"id":54614463,"name":"zazu","full_name":"tinytacoteam/zazu","owner":{"login":"tinytacoteam","id":12994756,"avatar_url":"https://avatars.githubusercontent.com/u/12994756?v=3","gravatar_id":"","url":"https://api.github.com/users/tinytacoteam","html_url":"https://github.com/tinytacoteam","followers_url":"https://api.github.com/users/tinytacoteam/followers","following_url":"https://api.github.com/users/tinytacoteam/following{/other_user}","gists_url":"https://api.github.com/users/tinytacoteam/gists{/gist_id}","starred_url":"https://api.github.com/users/tinytacoteam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tinytacoteam/subscriptions","organizations_url":"https://api.github.com/users/tinytacoteam/orgs","repos_url":"https://api.github.com/users/tinytacoteam/repos","events_url":"https://api.github.com/users/tinytacoteam/events{/privacy}","received_events_url":"https://api.github.com/users/tinytacoteam/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/tinytacoteam/zazu","description":":rocket: Cross platform productivity tool.","fork":false,"url":"https://api.github.com/repos/tinytacoteam/zazu","forks_url":"https://api.github.com/repos/tinytacoteam/zazu/forks","keys_url":"https://api.github.com/repos/tinytacoteam/zazu/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tinytacoteam/zazu/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tinytacoteam/zazu/teams","hooks_url":"https://api.github.com/repos/tinytacoteam/zazu/hooks","issue_events_url":"https://api.github.com/repos/tinytacoteam/zazu/issues/events{/number}","events_url":"https://api.github.com/repos/tinytacoteam/zazu/events","assignees_url":"https://api.github.com/repos/tinytacoteam/zazu/assignees{/user}","branches_url":"https://api.github.com/repos/tinytacoteam/zazu/branches{/branch}","tags_url":"https://api.github.com/repos/tinytacoteam/zazu/tags","blobs_url":"https://api.github.com/repos/tinytacoteam/zazu/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tinytacoteam/zazu/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tinytacoteam/zazu/git/refs{/sha}","trees_url":"https://api.github.com/repos/tinytacoteam/zazu/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tinytacoteam/zazu/statuses/{sha}","languages_url":"https://api.github.com/repos/tinytacoteam/zazu/languages","stargazers_url":"https://api.github.com/repos/tinytacoteam/zazu/stargazers","contributors_url":"https://api.github.com/repos/tinytacoteam/zazu/contributors","subscribers_url":"https://api.github.com/repos/tinytacoteam/zazu/subscribers","subscription_url":"https://api.github.com/repos/tinytacoteam/zazu/subscription","commits_url":"https://api.github.com/repos/tinytacoteam/zazu/commits{/sha}","git_commits_url":"https://api.github.com/repos/tinytacoteam/zazu/git/commits{/sha}","comments_url":"https://api.github.com/repos/tinytacoteam/zazu/comments{/number}","issue_comment_url":"https://api.github.com/repos/tinytacoteam/zazu/issues/comments{/number}","contents_url":"https://api.github.com/repos/tinytacoteam/zazu/contents/{+path}","compare_url":"https://api.github.com/repos/tinytacoteam/zazu/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tinytacoteam/zazu/merges","archive_url":"https://api.github.com/repos/tinytacoteam/zazu/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tinytacoteam/zazu/downloads","issues_url":"https://api.github.com/repos/tinytacoteam/zazu/issues{/number}","pulls_url":"https://api.github.com/repos/tinytacoteam/zazu/pulls{/number}","milestones_url":"https://api.github.com/repos/tinytacoteam/zazu/milestones{/number}","notifications_url":"https://api.github.com/repos/tinytacoteam/zazu/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tinytacoteam/zazu/labels{/name}","releases_url":"https://api.github.com/repos/tinytacoteam/zazu/releases{/id}","deployments_url":"https://api.github.com/repos/tinytacoteam/zazu/deployments","created_at":"2016-03-24T04:26:04Z","updated_at":"2016-07-29T02:19:00Z","pushed_at":"2016-07-31T04:44:05Z","git_url":"git://github.com/tinytacoteam/zazu.git","ssh_url":"git@github.com:tinytacoteam/zazu.git","clone_url":"https://github.com/tinytacoteam/zazu.git","svn_url":"https://github.com/tinytacoteam/zazu","homepage":"http://zazuapp.org","size":1575,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1,"mirror_url":null,"open_issues_count":14,"forks":1,"open_issues":14,"watchers":0,"default_branch":"master"}},"base":{"label":"tinytacoteam:master","ref":"master","sha":"3dda1b1cb050aac2d693db0ace1b7fb47563f7c3","user":{"login":"tinytacoteam","id":12994756,"avatar_url":"https://avatars.githubusercontent.com/u/12994756?v=3","gravatar_id":"","url":"https://api.github.com/users/tinytacoteam","html_url":"https://github.com/tinytacoteam","followers_url":"https://api.github.com/users/tinytacoteam/followers","following_url":"https://api.github.com/users/tinytacoteam/following{/other_user}","gists_url":"https://api.github.com/users/tinytacoteam/gists{/gist_id}","starred_url":"https://api.github.com/users/tinytacoteam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tinytacoteam/subscriptions","organizations_url":"https://api.github.com/users/tinytacoteam/orgs","repos_url":"https://api.github.com/users/tinytacoteam/repos","events_url":"https://api.github.com/users/tinytacoteam/events{/privacy}","received_events_url":"https://api.github.com/users/tinytacoteam/received_events","type":"Organization","site_admin":false},"repo":{"id":54614463,"name":"zazu","full_name":"tinytacoteam/zazu","owner":{"login":"tinytacoteam","id":12994756,"avatar_url":"https://avatars.githubusercontent.com/u/12994756?v=3","gravatar_id":"","url":"https://api.github.com/users/tinytacoteam","html_url":"https://github.com/tinytacoteam","followers_url":"https://api.github.com/users/tinytacoteam/followers","following_url":"https://api.github.com/users/tinytacoteam/following{/other_user}","gists_url":"https://api.github.com/users/tinytacoteam/gists{/gist_id}","starred_url":"https://api.github.com/users/tinytacoteam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tinytacoteam/subscriptions","organizations_url":"https://api.github.com/users/tinytacoteam/orgs","repos_url":"https://api.github.com/users/tinytacoteam/repos","events_url":"https://api.github.com/users/tinytacoteam/events{/privacy}","received_events_url":"https://api.github.com/users/tinytacoteam/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/tinytacoteam/zazu","description":":rocket: Cross platform productivity tool.","fork":false,"url":"https://api.github.com/repos/tinytacoteam/zazu","forks_url":"https://api.github.com/repos/tinytacoteam/zazu/forks","keys_url":"https://api.github.com/repos/tinytacoteam/zazu/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tinytacoteam/zazu/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tinytacoteam/zazu/teams","hooks_url":"https://api.github.com/repos/tinytacoteam/zazu/hooks","issue_events_url":"https://api.github.com/repos/tinytacoteam/zazu/issues/events{/number}","events_url":"https://api.github.com/repos/tinytacoteam/zazu/events","assignees_url":"https://api.github.com/repos/tinytacoteam/zazu/assignees{/user}","branches_url":"https://api.github.com/repos/tinytacoteam/zazu/branches{/branch}","tags_url":"https://api.github.com/repos/tinytacoteam/zazu/tags","blobs_url":"https://api.github.com/repos/tinytacoteam/zazu/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tinytacoteam/zazu/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tinytacoteam/zazu/git/refs{/sha}","trees_url":"https://api.github.com/repos/tinytacoteam/zazu/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tinytacoteam/zazu/statuses/{sha}","languages_url":"https://api.github.com/repos/tinytacoteam/zazu/languages","stargazers_url":"https://api.github.com/repos/tinytacoteam/zazu/stargazers","contributors_url":"https://api.github.com/repos/tinytacoteam/zazu/contributors","subscribers_url":"https://api.github.com/repos/tinytacoteam/zazu/subscribers","subscription_url":"https://api.github.com/repos/tinytacoteam/zazu/subscription","commits_url":"https://api.github.com/repos/tinytacoteam/zazu/commits{/sha}","git_commits_url":"https://api.github.com/repos/tinytacoteam/zazu/git/commits{/sha}","comments_url":"https://api.github.com/repos/tinytacoteam/zazu/comments{/number}","issue_comment_url":"https://api.github.com/repos/tinytacoteam/zazu/issues/comments{/number}","contents_url":"https://api.github.com/repos/tinytacoteam/zazu/contents/{+path}","compare_url":"https://api.github.com/repos/tinytacoteam/zazu/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tinytacoteam/zazu/merges","archive_url":"https://api.github.com/repos/tinytacoteam/zazu/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tinytacoteam/zazu/downloads","issues_url":"https://api.github.com/repos/tinytacoteam/zazu/issues{/number}","pulls_url":"https://api.github.com/repos/tinytacoteam/zazu/pulls{/number}","milestones_url":"https://api.github.com/repos/tinytacoteam/zazu/milestones{/number}","notifications_url":"https://api.github.com/repos/tinytacoteam/zazu/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tinytacoteam/zazu/labels{/name}","releases_url":"https://api.github.com/repos/tinytacoteam/zazu/releases{/id}","deployments_url":"https://api.github.com/repos/tinytacoteam/zazu/deployments","created_at":"2016-03-24T04:26:04Z","updated_at":"2016-07-29T02:19:00Z","pushed_at":"2016-07-31T04:44:05Z","git_url":"git://github.com/tinytacoteam/zazu.git","ssh_url":"git@github.com:tinytacoteam/zazu.git","clone_url":"https://github.com/tinytacoteam/zazu.git","svn_url":"https://github.com/tinytacoteam/zazu","homepage":"http://zazuapp.org","size":1575,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1,"mirror_url":null,"open_issues_count":14,"forks":1,"open_issues":14,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/tinytacoteam/zazu/pulls/43"},"html":{"href":"https://github.com/tinytacoteam/zazu/pull/43"},"issue":{"href":"https://api.github.com/repos/tinytacoteam/zazu/issues/43"},"comments":{"href":"https://api.github.com/repos/tinytacoteam/zazu/issues/43/comments"},"review_comments":{"href":"https://api.github.com/repos/tinytacoteam/zazu/pulls/43/comments"},"review_comment":{"href":"https://api.github.com/repos/tinytacoteam/zazu/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/tinytacoteam/zazu/pulls/43/commits"},"statuses":{"href":"https://api.github.com/repos/tinytacoteam/zazu/statuses/dba241d08481b49182e9e4c8f51ae6e4f9ff1f4b"}}}}
{"actor":{"display_login":"blainesch"}}