{"action":"created","comment":{"url":"https://api.github.com/repos/Polymer/core-localstorage/pulls/comments/25532776","id":25532776,"diff_hunk":"@@ -26,52 +26,95 @@\n \n <link rel=\"import\" href=\"../polymer/polymer.html\">\n \n-<polymer-element name=\"core-localstorage\" attributes=\"name value useRaw autoSaveDisabled\" hidden>\n <script>\n \n-  Polymer('core-localstorage', {\n-    \n+  Polymer({\n+    is: 'core-localstorage',\n     /**\n      * Fired when a value is loaded from localStorage.\n      * @event core-localstorage-load\n      */\n-     \n-    /**\n-     * The key to the data stored in localStorage.\n-     *\n-     * @attribute name\n-     * @type string\n-     * @default null\n-     */\n-    name: '',\n-    \n-    /**\n-     * The data associated with the specified name.\n-     *\n-     * @attribute value\n-     * @type object\n-     * @default null\n-     */\n-    value: null,\n-    \n-    /**\n-     * If true, the value is stored and retrieved without JSON processing.\n-     *\n-     * @attribute useRaw\n-     * @type boolean\n-     * @default false\n-     */\n-    useRaw: false,\n-    \n+\n     /**\n-     * If true, auto save is disabled.\n-     *\n-     * @attribute autoSaveDisabled\n-     * @type boolean\n-     * @default false\n+     * Fired when localStorage was changed outside of current document (mirrors window storage event)\n+     * @event core-localstorage-global-change\n      */\n-    autoSaveDisabled: false,\n-    \n+\n+    published: {\n+      /**\n+       * The key to the data stored in localStorage.\n+       *\n+       * @attribute name\n+       * @type string\n+       * @default null\n+       */\n+      name: {\n+        type: String,\n+        reflect: true\n+      },\n+      /**\n+       * The data associated with the specified name.\n+       *\n+       * @attribute value\n+       * @type object\n+       * @default null\n+       */\n+      value: {\n+        type: Object,\n+        notify: true\n+      },\n+      \n+      /**\n+       * If true, the value is stored and retrieved without JSON processing.\n+       *\n+       * @attribute useRaw\n+       * @type boolean\n+       * @default false\n+       */\n+      useRaw: Boolean,\n+      \n+      /**\n+       * If true, auto save is disabled.\n+       *\n+       * @attribute autoSaveDisabled\n+       * @type boolean\n+       * @default false\n+       */\n+      autoSaveDisabled: {\n+        type: Boolean,\n+        reflect: true\n+      }\n+    },\n+\n+    configure: function() {\n+      return {\n+        // value: null, do not initialize value, no need to call \n+        name: '',\n+        useRaw: false,\n+        autoSaveDisabled: false\n+      }\n+    },\n+    bind: {\n+      name: 'nameChanged',\n+      value: 'valueChanged'\n+    },\n+\n+    attached: function() {\n+      this._handleStorage = this.handleStorage.bind(this);\n+      window.addEventListener('storage', this._handleStorage);\n+    },\n+\n+    detached: function() {\n+      window.removeEventListener('storage', this._handleStorage);\n+    },\n+\n+    handleStorage: function(ev) {\n+      if (e.key == this.name) {","path":"core-localstorage.html","position":125,"original_position":125,"commit_id":"ac7234a8bb2e6086983c787081c19658efb28f10","original_commit_id":"ac7234a8bb2e6086983c787081c19658efb28f10","user":{"login":"cdata","id":240083,"avatar_url":"https://avatars.githubusercontent.com/u/240083?v=3","gravatar_id":"","url":"https://api.github.com/users/cdata","html_url":"https://github.com/cdata","followers_url":"https://api.github.com/users/cdata/followers","following_url":"https://api.github.com/users/cdata/following{/other_user}","gists_url":"https://api.github.com/users/cdata/gists{/gist_id}","starred_url":"https://api.github.com/users/cdata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cdata/subscriptions","organizations_url":"https://api.github.com/users/cdata/orgs","repos_url":"https://api.github.com/users/cdata/repos","events_url":"https://api.github.com/users/cdata/events{/privacy}","received_events_url":"https://api.github.com/users/cdata/received_events","type":"User","site_admin":false},"body":"Now I'm even more in favor of using `key` instead of `name` :grimacing: ","created_at":"2015-02-27T19:40:38Z","updated_at":"2015-02-27T19:40:38Z","html_url":"https://github.com/Polymer/core-localstorage/pull/13#discussion_r25532776","pull_request_url":"https://api.github.com/repos/Polymer/core-localstorage/pulls/13","_links":{"self":{"href":"https://api.github.com/repos/Polymer/core-localstorage/pulls/comments/25532776"},"html":{"href":"https://github.com/Polymer/core-localstorage/pull/13#discussion_r25532776"},"pull_request":{"href":"https://api.github.com/repos/Polymer/core-localstorage/pulls/13"}}},"pull_request":{"url":"https://api.github.com/repos/Polymer/core-localstorage/pulls/13","id":30190226,"html_url":"https://github.com/Polymer/core-localstorage/pull/13","diff_url":"https://github.com/Polymer/core-localstorage/pull/13.diff","patch_url":"https://github.com/Polymer/core-localstorage/pull/13.patch","issue_url":"https://api.github.com/repos/Polymer/core-localstorage/issues/13","number":13,"state":"open","locked":false,"title":"0.8 preview","user":{"login":"garlicnation","id":1105965,"avatar_url":"https://avatars.githubusercontent.com/u/1105965?v=3","gravatar_id":"","url":"https://api.github.com/users/garlicnation","html_url":"https://github.com/garlicnation","followers_url":"https://api.github.com/users/garlicnation/followers","following_url":"https://api.github.com/users/garlicnation/following{/other_user}","gists_url":"https://api.github.com/users/garlicnation/gists{/gist_id}","starred_url":"https://api.github.com/users/garlicnation/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/garlicnation/subscriptions","organizations_url":"https://api.github.com/users/garlicnation/orgs","repos_url":"https://api.github.com/users/garlicnation/repos","events_url":"https://api.github.com/users/garlicnation/events{/privacy}","received_events_url":"https://api.github.com/users/garlicnation/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-02-27T18:45:02Z","updated_at":"2015-02-27T19:40:38Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b83db36c093040ab76b8361353d6ae6c625f960c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Polymer/core-localstorage/pulls/13/commits","review_comments_url":"https://api.github.com/repos/Polymer/core-localstorage/pulls/13/comments","review_comment_url":"https://api.github.com/repos/Polymer/core-localstorage/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Polymer/core-localstorage/issues/13/comments","statuses_url":"https://api.github.com/repos/Polymer/core-localstorage/statuses/ac7234a8bb2e6086983c787081c19658efb28f10","head":{"label":"atotic:0.8-preview","ref":"0.8-preview","sha":"ac7234a8bb2e6086983c787081c19658efb28f10","user":{"login":"atotic","id":127453,"avatar_url":"https://avatars.githubusercontent.com/u/127453?v=3","gravatar_id":"","url":"https://api.github.com/users/atotic","html_url":"https://github.com/atotic","followers_url":"https://api.github.com/users/atotic/followers","following_url":"https://api.github.com/users/atotic/following{/other_user}","gists_url":"https://api.github.com/users/atotic/gists{/gist_id}","starred_url":"https://api.github.com/users/atotic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/atotic/subscriptions","organizations_url":"https://api.github.com/users/atotic/orgs","repos_url":"https://api.github.com/users/atotic/repos","events_url":"https://api.github.com/users/atotic/events{/privacy}","received_events_url":"https://api.github.com/users/atotic/received_events","type":"User","site_admin":false},"repo":{"id":31284696,"name":"core-localstorage","full_name":"atotic/core-localstorage","owner":{"login":"atotic","id":127453,"avatar_url":"https://avatars.githubusercontent.com/u/127453?v=3","gravatar_id":"","url":"https://api.github.com/users/atotic","html_url":"https://github.com/atotic","followers_url":"https://api.github.com/users/atotic/followers","following_url":"https://api.github.com/users/atotic/following{/other_user}","gists_url":"https://api.github.com/users/atotic/gists{/gist_id}","starred_url":"https://api.github.com/users/atotic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/atotic/subscriptions","organizations_url":"https://api.github.com/users/atotic/orgs","repos_url":"https://api.github.com/users/atotic/repos","events_url":"https://api.github.com/users/atotic/events{/privacy}","received_events_url":"https://api.github.com/users/atotic/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/atotic/core-localstorage","description":"Access to localStorage","fork":true,"url":"https://api.github.com/repos/atotic/core-localstorage","forks_url":"https://api.github.com/repos/atotic/core-localstorage/forks","keys_url":"https://api.github.com/repos/atotic/core-localstorage/keys{/key_id}","collaborators_url":"https://api.github.com/repos/atotic/core-localstorage/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/atotic/core-localstorage/teams","hooks_url":"https://api.github.com/repos/atotic/core-localstorage/hooks","issue_events_url":"https://api.github.com/repos/atotic/core-localstorage/issues/events{/number}","events_url":"https://api.github.com/repos/atotic/core-localstorage/events","assignees_url":"https://api.github.com/repos/atotic/core-localstorage/assignees{/user}","branches_url":"https://api.github.com/repos/atotic/core-localstorage/branches{/branch}","tags_url":"https://api.github.com/repos/atotic/core-localstorage/tags","blobs_url":"https://api.github.com/repos/atotic/core-localstorage/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/atotic/core-localstorage/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/atotic/core-localstorage/git/refs{/sha}","trees_url":"https://api.github.com/repos/atotic/core-localstorage/git/trees{/sha}","statuses_url":"https://api.github.com/repos/atotic/core-localstorage/statuses/{sha}","languages_url":"https://api.github.com/repos/atotic/core-localstorage/languages","stargazers_url":"https://api.github.com/repos/atotic/core-localstorage/stargazers","contributors_url":"https://api.github.com/repos/atotic/core-localstorage/contributors","subscribers_url":"https://api.github.com/repos/atotic/core-localstorage/subscribers","subscription_url":"https://api.github.com/repos/atotic/core-localstorage/subscription","commits_url":"https://api.github.com/repos/atotic/core-localstorage/commits{/sha}","git_commits_url":"https://api.github.com/repos/atotic/core-localstorage/git/commits{/sha}","comments_url":"https://api.github.com/repos/atotic/core-localstorage/comments{/number}","issue_comment_url":"https://api.github.com/repos/atotic/core-localstorage/issues/comments{/number}","contents_url":"https://api.github.com/repos/atotic/core-localstorage/contents/{+path}","compare_url":"https://api.github.com/repos/atotic/core-localstorage/compare/{base}...{head}","merges_url":"https://api.github.com/repos/atotic/core-localstorage/merges","archive_url":"https://api.github.com/repos/atotic/core-localstorage/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/atotic/core-localstorage/downloads","issues_url":"https://api.github.com/repos/atotic/core-localstorage/issues{/number}","pulls_url":"https://api.github.com/repos/atotic/core-localstorage/pulls{/number}","milestones_url":"https://api.github.com/repos/atotic/core-localstorage/milestones{/number}","notifications_url":"https://api.github.com/repos/atotic/core-localstorage/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/atotic/core-localstorage/labels{/name}","releases_url":"https://api.github.com/repos/atotic/core-localstorage/releases{/id}","created_at":"2015-02-24T22:13:35Z","updated_at":"2015-02-24T22:13:36Z","pushed_at":"2015-02-27T18:11:51Z","git_url":"git://github.com/atotic/core-localstorage.git","ssh_url":"git@github.com:atotic/core-localstorage.git","clone_url":"https://github.com/atotic/core-localstorage.git","svn_url":"https://github.com/atotic/core-localstorage","homepage":"","size":915,"stargazers_count":0,"watchers_count":0,"language":"HTML","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Polymer:0.8-preview","ref":"0.8-preview","sha":"2e956671a4402aaf928a9cdd613c21c1739ea1b8","user":{"login":"Polymer","id":2159051,"avatar_url":"https://avatars.githubusercontent.com/u/2159051?v=3","gravatar_id":"","url":"https://api.github.com/users/Polymer","html_url":"https://github.com/Polymer","followers_url":"https://api.github.com/users/Polymer/followers","following_url":"https://api.github.com/users/Polymer/following{/other_user}","gists_url":"https://api.github.com/users/Polymer/gists{/gist_id}","starred_url":"https://api.github.com/users/Polymer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Polymer/subscriptions","organizations_url":"https://api.github.com/users/Polymer/orgs","repos_url":"https://api.github.com/users/Polymer/repos","events_url":"https://api.github.com/users/Polymer/events{/privacy}","received_events_url":"https://api.github.com/users/Polymer/received_events","type":"Organization","site_admin":false},"repo":{"id":18771553,"name":"core-localstorage","full_name":"Polymer/core-localstorage","owner":{"login":"Polymer","id":2159051,"avatar_url":"https://avatars.githubusercontent.com/u/2159051?v=3","gravatar_id":"","url":"https://api.github.com/users/Polymer","html_url":"https://github.com/Polymer","followers_url":"https://api.github.com/users/Polymer/followers","following_url":"https://api.github.com/users/Polymer/following{/other_user}","gists_url":"https://api.github.com/users/Polymer/gists{/gist_id}","starred_url":"https://api.github.com/users/Polymer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Polymer/subscriptions","organizations_url":"https://api.github.com/users/Polymer/orgs","repos_url":"https://api.github.com/users/Polymer/repos","events_url":"https://api.github.com/users/Polymer/events{/privacy}","received_events_url":"https://api.github.com/users/Polymer/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Polymer/core-localstorage","description":"Access to localStorage","fork":false,"url":"https://api.github.com/repos/Polymer/core-localstorage","forks_url":"https://api.github.com/repos/Polymer/core-localstorage/forks","keys_url":"https://api.github.com/repos/Polymer/core-localstorage/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Polymer/core-localstorage/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Polymer/core-localstorage/teams","hooks_url":"https://api.github.com/repos/Polymer/core-localstorage/hooks","issue_events_url":"https://api.github.com/repos/Polymer/core-localstorage/issues/events{/number}","events_url":"https://api.github.com/repos/Polymer/core-localstorage/events","assignees_url":"https://api.github.com/repos/Polymer/core-localstorage/assignees{/user}","branches_url":"https://api.github.com/repos/Polymer/core-localstorage/branches{/branch}","tags_url":"https://api.github.com/repos/Polymer/core-localstorage/tags","blobs_url":"https://api.github.com/repos/Polymer/core-localstorage/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Polymer/core-localstorage/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Polymer/core-localstorage/git/refs{/sha}","trees_url":"https://api.github.com/repos/Polymer/core-localstorage/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Polymer/core-localstorage/statuses/{sha}","languages_url":"https://api.github.com/repos/Polymer/core-localstorage/languages","stargazers_url":"https://api.github.com/repos/Polymer/core-localstorage/stargazers","contributors_url":"https://api.github.com/repos/Polymer/core-localstorage/contributors","subscribers_url":"https://api.github.com/repos/Polymer/core-localstorage/subscribers","subscription_url":"https://api.github.com/repos/Polymer/core-localstorage/subscription","commits_url":"https://api.github.com/repos/Polymer/core-localstorage/commits{/sha}","git_commits_url":"https://api.github.com/repos/Polymer/core-localstorage/git/commits{/sha}","comments_url":"https://api.github.com/repos/Polymer/core-localstorage/comments{/number}","issue_comment_url":"https://api.github.com/repos/Polymer/core-localstorage/issues/comments{/number}","contents_url":"https://api.github.com/repos/Polymer/core-localstorage/contents/{+path}","compare_url":"https://api.github.com/repos/Polymer/core-localstorage/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Polymer/core-localstorage/merges","archive_url":"https://api.github.com/repos/Polymer/core-localstorage/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Polymer/core-localstorage/downloads","issues_url":"https://api.github.com/repos/Polymer/core-localstorage/issues{/number}","pulls_url":"https://api.github.com/repos/Polymer/core-localstorage/pulls{/number}","milestones_url":"https://api.github.com/repos/Polymer/core-localstorage/milestones{/number}","notifications_url":"https://api.github.com/repos/Polymer/core-localstorage/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Polymer/core-localstorage/labels{/name}","releases_url":"https://api.github.com/repos/Polymer/core-localstorage/releases{/id}","created_at":"2014-04-14T18:28:39Z","updated_at":"2015-02-11T22:41:37Z","pushed_at":"2015-02-27T18:32:09Z","git_url":"git://github.com/Polymer/core-localstorage.git","ssh_url":"git@github.com:Polymer/core-localstorage.git","clone_url":"https://github.com/Polymer/core-localstorage.git","svn_url":"https://github.com/Polymer/core-localstorage","homepage":"","size":1243,"stargazers_count":8,"watchers_count":8,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":11,"mirror_url":null,"open_issues_count":8,"forks":11,"open_issues":8,"watchers":8,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Polymer/core-localstorage/pulls/13"},"html":{"href":"https://github.com/Polymer/core-localstorage/pull/13"},"issue":{"href":"https://api.github.com/repos/Polymer/core-localstorage/issues/13"},"comments":{"href":"https://api.github.com/repos/Polymer/core-localstorage/issues/13/comments"},"review_comments":{"href":"https://api.github.com/repos/Polymer/core-localstorage/pulls/13/comments"},"review_comment":{"href":"https://api.github.com/repos/Polymer/core-localstorage/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Polymer/core-localstorage/pulls/13/commits"},"statuses":{"href":"https://api.github.com/repos/Polymer/core-localstorage/statuses/ac7234a8bb2e6086983c787081c19658efb28f10"}}}}