{"action":"created","comment":{"url":"https://api.github.com/repos/algolia/instantsearch.js/pulls/comments/269947043","pull_request_review_id":219948759,"id":269947043,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI2OTk0NzA0Mw==","diff_hunk":"@@ -0,0 +1,59 @@\n+import { InsightsClientMethod, InsightsClientPayload } from '../types';\n+\n+export function readDataAttributes(\n+  domElement: HTMLElement\n+): {\n+  method: InsightsClientMethod;\n+  payload: Partial<InsightsClientPayload>;\n+} {\n+  const method = domElement.getAttribute(\n+    'data-insights-method'\n+  ) as InsightsClientMethod;\n+  const serializedPayload = domElement.getAttribute('data-insights-payload');\n+  if (typeof serializedPayload !== 'string') {","path":"src/helpers/insights.ts","position":15,"original_position":13,"commit_id":"ba752f5e79dbd059da0b4a1fd1646c81e9d7b288","original_commit_id":"b183fb0407e03664bb925ecc9d089dcd8ee5805d","user":{"login":"tkrugg","id":2982512,"node_id":"MDQ6VXNlcjI5ODI1MTI=","avatar_url":"https://avatars3.githubusercontent.com/u/2982512?v=4","gravatar_id":"","url":"https://api.github.com/users/tkrugg","html_url":"https://github.com/tkrugg","followers_url":"https://api.github.com/users/tkrugg/followers","following_url":"https://api.github.com/users/tkrugg/following{/other_user}","gists_url":"https://api.github.com/users/tkrugg/gists{/gist_id}","starred_url":"https://api.github.com/users/tkrugg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tkrugg/subscriptions","organizations_url":"https://api.github.com/users/tkrugg/orgs","repos_url":"https://api.github.com/users/tkrugg/repos","events_url":"https://api.github.com/users/tkrugg/events{/privacy}","received_events_url":"https://api.github.com/users/tkrugg/received_events","type":"User","site_admin":false},"body":"yes, and typeof null === 'object'.\r\nThis check is there to make sure what we give to JSON.parse is a string.","created_at":"2019-03-28T10:53:29Z","updated_at":"2019-03-28T10:53:29Z","html_url":"https://github.com/algolia/instantsearch.js/pull/3598#discussion_r269947043","pull_request_url":"https://api.github.com/repos/algolia/instantsearch.js/pulls/3598","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/algolia/instantsearch.js/pulls/comments/269947043"},"html":{"href":"https://github.com/algolia/instantsearch.js/pull/3598#discussion_r269947043"},"pull_request":{"href":"https://api.github.com/repos/algolia/instantsearch.js/pulls/3598"}},"in_reply_to_id":269905224},"pull_request":{"url":"https://api.github.com/repos/algolia/instantsearch.js/pulls/3598","id":260071437,"node_id":"MDExOlB1bGxSZXF1ZXN0MjYwMDcxNDM3","html_url":"https://github.com/algolia/instantsearch.js/pull/3598","diff_url":"https://github.com/algolia/instantsearch.js/pull/3598.diff","patch_url":"https://github.com/algolia/instantsearch.js/pull/3598.patch","issue_url":"https://api.github.com/repos/algolia/instantsearch.js/issues/3598","number":3598,"state":"open","locked":false,"title":"feat(Insights): Insights inside Instantsearch","user":{"login":"tkrugg","id":2982512,"node_id":"MDQ6VXNlcjI5ODI1MTI=","avatar_url":"https://avatars3.githubusercontent.com/u/2982512?v=4","gravatar_id":"","url":"https://api.github.com/users/tkrugg","html_url":"https://github.com/tkrugg","followers_url":"https://api.github.com/users/tkrugg/followers","following_url":"https://api.github.com/users/tkrugg/following{/other_user}","gists_url":"https://api.github.com/users/tkrugg/gists{/gist_id}","starred_url":"https://api.github.com/users/tkrugg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tkrugg/subscriptions","organizations_url":"https://api.github.com/users/tkrugg/orgs","repos_url":"https://api.github.com/users/tkrugg/repos","events_url":"https://api.github.com/users/tkrugg/events{/privacy}","received_events_url":"https://api.github.com/users/tkrugg/received_events","type":"User","site_admin":false},"body":"**Summary**\r\n\r\nThis PR follows up on #3547 and aims to introduce 3 things\r\n- `withInsightsClient`: connector wrapper that exposes insights client to connectors\r\n- `helpers/insights`: which adds helpers that generate `data-insight-*` attributes \r\n- `withInsightsListener`: which wraps Hits and InfiniteHits components and listens to clicks on elements containing `data-insights-*` attributes.\r\n\r\n\r\n**Result**\r\nWIP\r\n\r\n","created_at":"2019-03-11T17:47:08Z","updated_at":"2019-03-28T10:53:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d7f3116d65b8e81f00b923bced20981f47b0f173","assignee":null,"assignees":[],"requested_reviewers":[{"login":"samouss","id":6513513,"node_id":"MDQ6VXNlcjY1MTM1MTM=","avatar_url":"https://avatars2.githubusercontent.com/u/6513513?v=4","gravatar_id":"","url":"https://api.github.com/users/samouss","html_url":"https://github.com/samouss","followers_url":"https://api.github.com/users/samouss/followers","following_url":"https://api.github.com/users/samouss/following{/other_user}","gists_url":"https://api.github.com/users/samouss/gists{/gist_id}","starred_url":"https://api.github.com/users/samouss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samouss/subscriptions","organizations_url":"https://api.github.com/users/samouss/orgs","repos_url":"https://api.github.com/users/samouss/repos","events_url":"https://api.github.com/users/samouss/events{/privacy}","received_events_url":"https://api.github.com/users/samouss/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/algolia/instantsearch.js/pulls/3598/commits","review_comments_url":"https://api.github.com/repos/algolia/instantsearch.js/pulls/3598/comments","review_comment_url":"https://api.github.com/repos/algolia/instantsearch.js/pulls/comments{/number}","comments_url":"https://api.github.com/repos/algolia/instantsearch.js/issues/3598/comments","statuses_url":"https://api.github.com/repos/algolia/instantsearch.js/statuses/ba752f5e79dbd059da0b4a1fd1646c81e9d7b288","head":{"label":"tkrugg:insights-connector","ref":"insights-connector","sha":"ba752f5e79dbd059da0b4a1fd1646c81e9d7b288","user":{"login":"tkrugg","id":2982512,"node_id":"MDQ6VXNlcjI5ODI1MTI=","avatar_url":"https://avatars3.githubusercontent.com/u/2982512?v=4","gravatar_id":"","url":"https://api.github.com/users/tkrugg","html_url":"https://github.com/tkrugg","followers_url":"https://api.github.com/users/tkrugg/followers","following_url":"https://api.github.com/users/tkrugg/following{/other_user}","gists_url":"https://api.github.com/users/tkrugg/gists{/gist_id}","starred_url":"https://api.github.com/users/tkrugg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tkrugg/subscriptions","organizations_url":"https://api.github.com/users/tkrugg/orgs","repos_url":"https://api.github.com/users/tkrugg/repos","events_url":"https://api.github.com/users/tkrugg/events{/privacy}","received_events_url":"https://api.github.com/users/tkrugg/received_events","type":"User","site_admin":false},"repo":{"id":152265984,"node_id":"MDEwOlJlcG9zaXRvcnkxNTIyNjU5ODQ=","name":"instantsearch.js","full_name":"tkrugg/instantsearch.js","private":false,"owner":{"login":"tkrugg","id":2982512,"node_id":"MDQ6VXNlcjI5ODI1MTI=","avatar_url":"https://avatars3.githubusercontent.com/u/2982512?v=4","gravatar_id":"","url":"https://api.github.com/users/tkrugg","html_url":"https://github.com/tkrugg","followers_url":"https://api.github.com/users/tkrugg/followers","following_url":"https://api.github.com/users/tkrugg/following{/other_user}","gists_url":"https://api.github.com/users/tkrugg/gists{/gist_id}","starred_url":"https://api.github.com/users/tkrugg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tkrugg/subscriptions","organizations_url":"https://api.github.com/users/tkrugg/orgs","repos_url":"https://api.github.com/users/tkrugg/repos","events_url":"https://api.github.com/users/tkrugg/events{/privacy}","received_events_url":"https://api.github.com/users/tkrugg/received_events","type":"User","site_admin":false},"html_url":"https://github.com/tkrugg/instantsearch.js","description":":zap: Lightning-fast search for your apps, by Algolia","fork":true,"url":"https://api.github.com/repos/tkrugg/instantsearch.js","forks_url":"https://api.github.com/repos/tkrugg/instantsearch.js/forks","keys_url":"https://api.github.com/repos/tkrugg/instantsearch.js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tkrugg/instantsearch.js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tkrugg/instantsearch.js/teams","hooks_url":"https://api.github.com/repos/tkrugg/instantsearch.js/hooks","issue_events_url":"https://api.github.com/repos/tkrugg/instantsearch.js/issues/events{/number}","events_url":"https://api.github.com/repos/tkrugg/instantsearch.js/events","assignees_url":"https://api.github.com/repos/tkrugg/instantsearch.js/assignees{/user}","branches_url":"https://api.github.com/repos/tkrugg/instantsearch.js/branches{/branch}","tags_url":"https://api.github.com/repos/tkrugg/instantsearch.js/tags","blobs_url":"https://api.github.com/repos/tkrugg/instantsearch.js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tkrugg/instantsearch.js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tkrugg/instantsearch.js/git/refs{/sha}","trees_url":"https://api.github.com/repos/tkrugg/instantsearch.js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tkrugg/instantsearch.js/statuses/{sha}","languages_url":"https://api.github.com/repos/tkrugg/instantsearch.js/languages","stargazers_url":"https://api.github.com/repos/tkrugg/instantsearch.js/stargazers","contributors_url":"https://api.github.com/repos/tkrugg/instantsearch.js/contributors","subscribers_url":"https://api.github.com/repos/tkrugg/instantsearch.js/subscribers","subscription_url":"https://api.github.com/repos/tkrugg/instantsearch.js/subscription","commits_url":"https://api.github.com/repos/tkrugg/instantsearch.js/commits{/sha}","git_commits_url":"https://api.github.com/repos/tkrugg/instantsearch.js/git/commits{/sha}","comments_url":"https://api.github.com/repos/tkrugg/instantsearch.js/comments{/number}","issue_comment_url":"https://api.github.com/repos/tkrugg/instantsearch.js/issues/comments{/number}","contents_url":"https://api.github.com/repos/tkrugg/instantsearch.js/contents/{+path}","compare_url":"https://api.github.com/repos/tkrugg/instantsearch.js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tkrugg/instantsearch.js/merges","archive_url":"https://api.github.com/repos/tkrugg/instantsearch.js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tkrugg/instantsearch.js/downloads","issues_url":"https://api.github.com/repos/tkrugg/instantsearch.js/issues{/number}","pulls_url":"https://api.github.com/repos/tkrugg/instantsearch.js/pulls{/number}","milestones_url":"https://api.github.com/repos/tkrugg/instantsearch.js/milestones{/number}","notifications_url":"https://api.github.com/repos/tkrugg/instantsearch.js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tkrugg/instantsearch.js/labels{/name}","releases_url":"https://api.github.com/repos/tkrugg/instantsearch.js/releases{/id}","deployments_url":"https://api.github.com/repos/tkrugg/instantsearch.js/deployments","created_at":"2018-10-09T14:29:19Z","updated_at":"2018-10-25T15:27:12Z","pushed_at":"2019-03-28T09:58:41Z","git_url":"git://github.com/tkrugg/instantsearch.js.git","ssh_url":"git@github.com:tkrugg/instantsearch.js.git","clone_url":"https://github.com/tkrugg/instantsearch.js.git","svn_url":"https://github.com/tkrugg/instantsearch.js","homepage":"https://community.algolia.com/instantsearch.js","size":261712,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"algolia:develop","ref":"develop","sha":"ca8ae5018b93b98e663b623c2ba829b01a7f2861","user":{"login":"algolia","id":2034458,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIwMzQ0NTg=","avatar_url":"https://avatars0.githubusercontent.com/u/2034458?v=4","gravatar_id":"","url":"https://api.github.com/users/algolia","html_url":"https://github.com/algolia","followers_url":"https://api.github.com/users/algolia/followers","following_url":"https://api.github.com/users/algolia/following{/other_user}","gists_url":"https://api.github.com/users/algolia/gists{/gist_id}","starred_url":"https://api.github.com/users/algolia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/algolia/subscriptions","organizations_url":"https://api.github.com/users/algolia/orgs","repos_url":"https://api.github.com/users/algolia/repos","events_url":"https://api.github.com/users/algolia/events{/privacy}","received_events_url":"https://api.github.com/users/algolia/received_events","type":"Organization","site_admin":false},"repo":{"id":39443258,"node_id":"MDEwOlJlcG9zaXRvcnkzOTQ0MzI1OA==","name":"instantsearch.js","full_name":"algolia/instantsearch.js","private":false,"owner":{"login":"algolia","id":2034458,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIwMzQ0NTg=","avatar_url":"https://avatars0.githubusercontent.com/u/2034458?v=4","gravatar_id":"","url":"https://api.github.com/users/algolia","html_url":"https://github.com/algolia","followers_url":"https://api.github.com/users/algolia/followers","following_url":"https://api.github.com/users/algolia/following{/other_user}","gists_url":"https://api.github.com/users/algolia/gists{/gist_id}","starred_url":"https://api.github.com/users/algolia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/algolia/subscriptions","organizations_url":"https://api.github.com/users/algolia/orgs","repos_url":"https://api.github.com/users/algolia/repos","events_url":"https://api.github.com/users/algolia/events{/privacy}","received_events_url":"https://api.github.com/users/algolia/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/algolia/instantsearch.js","description":":zap: A JavaScript library for building performant and instant search experiences with Algolia.","fork":false,"url":"https://api.github.com/repos/algolia/instantsearch.js","forks_url":"https://api.github.com/repos/algolia/instantsearch.js/forks","keys_url":"https://api.github.com/repos/algolia/instantsearch.js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/algolia/instantsearch.js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/algolia/instantsearch.js/teams","hooks_url":"https://api.github.com/repos/algolia/instantsearch.js/hooks","issue_events_url":"https://api.github.com/repos/algolia/instantsearch.js/issues/events{/number}","events_url":"https://api.github.com/repos/algolia/instantsearch.js/events","assignees_url":"https://api.github.com/repos/algolia/instantsearch.js/assignees{/user}","branches_url":"https://api.github.com/repos/algolia/instantsearch.js/branches{/branch}","tags_url":"https://api.github.com/repos/algolia/instantsearch.js/tags","blobs_url":"https://api.github.com/repos/algolia/instantsearch.js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/algolia/instantsearch.js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/algolia/instantsearch.js/git/refs{/sha}","trees_url":"https://api.github.com/repos/algolia/instantsearch.js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/algolia/instantsearch.js/statuses/{sha}","languages_url":"https://api.github.com/repos/algolia/instantsearch.js/languages","stargazers_url":"https://api.github.com/repos/algolia/instantsearch.js/stargazers","contributors_url":"https://api.github.com/repos/algolia/instantsearch.js/contributors","subscribers_url":"https://api.github.com/repos/algolia/instantsearch.js/subscribers","subscription_url":"https://api.github.com/repos/algolia/instantsearch.js/subscription","commits_url":"https://api.github.com/repos/algolia/instantsearch.js/commits{/sha}","git_commits_url":"https://api.github.com/repos/algolia/instantsearch.js/git/commits{/sha}","comments_url":"https://api.github.com/repos/algolia/instantsearch.js/comments{/number}","issue_comment_url":"https://api.github.com/repos/algolia/instantsearch.js/issues/comments{/number}","contents_url":"https://api.github.com/repos/algolia/instantsearch.js/contents/{+path}","compare_url":"https://api.github.com/repos/algolia/instantsearch.js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/algolia/instantsearch.js/merges","archive_url":"https://api.github.com/repos/algolia/instantsearch.js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/algolia/instantsearch.js/downloads","issues_url":"https://api.github.com/repos/algolia/instantsearch.js/issues{/number}","pulls_url":"https://api.github.com/repos/algolia/instantsearch.js/pulls{/number}","milestones_url":"https://api.github.com/repos/algolia/instantsearch.js/milestones{/number}","notifications_url":"https://api.github.com/repos/algolia/instantsearch.js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/algolia/instantsearch.js/labels{/name}","releases_url":"https://api.github.com/repos/algolia/instantsearch.js/releases{/id}","deployments_url":"https://api.github.com/repos/algolia/instantsearch.js/deployments","created_at":"2015-07-21T12:10:27Z","updated_at":"2019-03-28T07:36:27Z","pushed_at":"2019-03-28T10:53:09Z","git_url":"git://github.com/algolia/instantsearch.js.git","ssh_url":"git@github.com:algolia/instantsearch.js.git","clone_url":"https://github.com/algolia/instantsearch.js.git","svn_url":"https://github.com/algolia/instantsearch.js","homepage":"https://www.algolia.com/doc/guides/building-search-ui/what-is-instantsearch/js/","size":277016,"stargazers_count":2207,"watchers_count":2207,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":328,"mirror_url":null,"archived":false,"open_issues_count":102,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":328,"open_issues":102,"watchers":2207,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/algolia/instantsearch.js/pulls/3598"},"html":{"href":"https://github.com/algolia/instantsearch.js/pull/3598"},"issue":{"href":"https://api.github.com/repos/algolia/instantsearch.js/issues/3598"},"comments":{"href":"https://api.github.com/repos/algolia/instantsearch.js/issues/3598/comments"},"review_comments":{"href":"https://api.github.com/repos/algolia/instantsearch.js/pulls/3598/comments"},"review_comment":{"href":"https://api.github.com/repos/algolia/instantsearch.js/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/algolia/instantsearch.js/pulls/3598/commits"},"statuses":{"href":"https://api.github.com/repos/algolia/instantsearch.js/statuses/ba752f5e79dbd059da0b4a1fd1646c81e9d7b288"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"tkrugg"}}