{"action":"created","comment":{"url":"https://api.github.com/repos/algolia/react-instantsearch/pulls/comments/151925581","pull_request_review_id":77705021,"id":151925581,"diff_hunk":"@@ -0,0 +1,128 @@\n+import React, { Component } from 'react';\n+import { storiesOf } from '@storybook/react';\n+import { InstantSearch, SearchBox } from '../packages/react-instantsearch/dom';\n+import { CustomHits } from './util';\n+\n+const stories = storiesOf('RefreshCache', module);\n+const buttonStyle = {\n+  borderRadius: '4px',\n+  padding: '10px',\n+  border: 'none',\n+  fontSize: '12px',\n+  cursor: 'pointer',\n+  color: '#fff',\n+  background: '#3369e7',\n+};\n+\n+const divStyle = {\n+  borderRadius: '2px',\n+  padding: '10px',\n+  marginTop: '15px',\n+  border: 'none',\n+  fontSize: '12px',\n+  color: '#999999',\n+  background: '#F3F3F3',\n+  display: 'block',\n+};\n+\n+class AppWithRefresh extends Component {\n+  constructor(props) {\n+    super(props);\n+    this.state = {\n+      refresh: false,\n+    };\n+    this.refresh = this.refresh.bind(this);","path":"stories/RefreshCache.stories.js","position":34,"original_position":34,"commit_id":"72d865c0eaa0d828a44758d987f37f3da3467b03","original_commit_id":"72d865c0eaa0d828a44758d987f37f3da3467b03","user":{"login":"samouss","id":6513513,"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},"body":"You could use the function property instead of `bind`, like you do with `onSearchStateChange`.","created_at":"2017-11-20T08:28:29Z","updated_at":"2017-11-20T08:32:38Z","html_url":"https://github.com/algolia/react-instantsearch/pull/619#discussion_r151925581","pull_request_url":"https://api.github.com/repos/algolia/react-instantsearch/pulls/619","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/algolia/react-instantsearch/pulls/comments/151925581"},"html":{"href":"https://github.com/algolia/react-instantsearch/pull/619#discussion_r151925581"},"pull_request":{"href":"https://api.github.com/repos/algolia/react-instantsearch/pulls/619"}}},"pull_request":{"url":"https://api.github.com/repos/algolia/react-instantsearch/pulls/619","id":153293259,"html_url":"https://github.com/algolia/react-instantsearch/pull/619","diff_url":"https://github.com/algolia/react-instantsearch/pull/619.diff","patch_url":"https://github.com/algolia/react-instantsearch/pull/619.patch","issue_url":"https://api.github.com/repos/algolia/react-instantsearch/issues/619","number":619,"state":"open","locked":false,"title":"feat(refreshcache): add prop refresh to InstantSearch instance","user":{"login":"marielaures","id":21305268,"avatar_url":"https://avatars1.githubusercontent.com/u/21305268?v=4","gravatar_id":"","url":"https://api.github.com/users/marielaures","html_url":"https://github.com/marielaures","followers_url":"https://api.github.com/users/marielaures/followers","following_url":"https://api.github.com/users/marielaures/following{/other_user}","gists_url":"https://api.github.com/users/marielaures/gists{/gist_id}","starred_url":"https://api.github.com/users/marielaures/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marielaures/subscriptions","organizations_url":"https://api.github.com/users/marielaures/orgs","repos_url":"https://api.github.com/users/marielaures/repos","events_url":"https://api.github.com/users/marielaures/events{/privacy}","received_events_url":"https://api.github.com/users/marielaures/received_events","type":"User","site_admin":false},"body":"**Summary**\r\n\r\nThe goal of this PR is to make it possible to refresh an InstantSearch instance.\r\nIt is allows the user to make a new request to Algolia in case a change has happened on the index for instance instead of getting the results from the cache.\r\n\r\nFixes #252. \r\n\r\n\r\n**Result**\r\n\r\nAdding a prop `refresh` to the `InstantSearch` component will trigger the refresh. \r\nIt takes a Boolean as an argument.\r\n\r\n```\r\n  <InstantSearch\r\n        appId=\"xyz\"\r\n        apiKey=\"xyz\"\r\n        indexName=\"indexName\"\r\n        refresh={this.state.refresh}\r\n  >\r\n```\r\n\r\nYou can see how it works on the refreshCache story in Storybook. \r\n\r\n![demo](https://user-images.githubusercontent.com/21305268/32949140-01a15a1a-cba2-11e7-9ec4-de7f926f6d7f.gif)\r\n","created_at":"2017-11-17T13:05:07Z","updated_at":"2017-11-20T08:32:38Z","closed_at":null,"merged_at":null,"merge_commit_sha":"dcc78e119956fbeb18b64013099f5afbbe6a9c0a","assignee":null,"assignees":[],"requested_reviewers":[{"login":"vvo","id":123822,"avatar_url":"https://avatars0.githubusercontent.com/u/123822?v=4","gravatar_id":"","url":"https://api.github.com/users/vvo","html_url":"https://github.com/vvo","followers_url":"https://api.github.com/users/vvo/followers","following_url":"https://api.github.com/users/vvo/following{/other_user}","gists_url":"https://api.github.com/users/vvo/gists{/gist_id}","starred_url":"https://api.github.com/users/vvo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vvo/subscriptions","organizations_url":"https://api.github.com/users/vvo/orgs","repos_url":"https://api.github.com/users/vvo/repos","events_url":"https://api.github.com/users/vvo/events{/privacy}","received_events_url":"https://api.github.com/users/vvo/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/algolia/react-instantsearch/pulls/619/commits","review_comments_url":"https://api.github.com/repos/algolia/react-instantsearch/pulls/619/comments","review_comment_url":"https://api.github.com/repos/algolia/react-instantsearch/pulls/comments{/number}","comments_url":"https://api.github.com/repos/algolia/react-instantsearch/issues/619/comments","statuses_url":"https://api.github.com/repos/algolia/react-instantsearch/statuses/72d865c0eaa0d828a44758d987f37f3da3467b03","head":{"label":"algolia:feat/refreshcache","ref":"feat/refreshcache","sha":"72d865c0eaa0d828a44758d987f37f3da3467b03","user":{"login":"algolia","id":2034458,"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":87180009,"name":"react-instantsearch","full_name":"algolia/react-instantsearch","owner":{"login":"algolia","id":2034458,"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},"private":false,"html_url":"https://github.com/algolia/react-instantsearch","description":"⚡ Lightning-fast search for React and React Native apps, by Algolia.","fork":false,"url":"https://api.github.com/repos/algolia/react-instantsearch","forks_url":"https://api.github.com/repos/algolia/react-instantsearch/forks","keys_url":"https://api.github.com/repos/algolia/react-instantsearch/keys{/key_id}","collaborators_url":"https://api.github.com/repos/algolia/react-instantsearch/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/algolia/react-instantsearch/teams","hooks_url":"https://api.github.com/repos/algolia/react-instantsearch/hooks","issue_events_url":"https://api.github.com/repos/algolia/react-instantsearch/issues/events{/number}","events_url":"https://api.github.com/repos/algolia/react-instantsearch/events","assignees_url":"https://api.github.com/repos/algolia/react-instantsearch/assignees{/user}","branches_url":"https://api.github.com/repos/algolia/react-instantsearch/branches{/branch}","tags_url":"https://api.github.com/repos/algolia/react-instantsearch/tags","blobs_url":"https://api.github.com/repos/algolia/react-instantsearch/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/algolia/react-instantsearch/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/algolia/react-instantsearch/git/refs{/sha}","trees_url":"https://api.github.com/repos/algolia/react-instantsearch/git/trees{/sha}","statuses_url":"https://api.github.com/repos/algolia/react-instantsearch/statuses/{sha}","languages_url":"https://api.github.com/repos/algolia/react-instantsearch/languages","stargazers_url":"https://api.github.com/repos/algolia/react-instantsearch/stargazers","contributors_url":"https://api.github.com/repos/algolia/react-instantsearch/contributors","subscribers_url":"https://api.github.com/repos/algolia/react-instantsearch/subscribers","subscription_url":"https://api.github.com/repos/algolia/react-instantsearch/subscription","commits_url":"https://api.github.com/repos/algolia/react-instantsearch/commits{/sha}","git_commits_url":"https://api.github.com/repos/algolia/react-instantsearch/git/commits{/sha}","comments_url":"https://api.github.com/repos/algolia/react-instantsearch/comments{/number}","issue_comment_url":"https://api.github.com/repos/algolia/react-instantsearch/issues/comments{/number}","contents_url":"https://api.github.com/repos/algolia/react-instantsearch/contents/{+path}","compare_url":"https://api.github.com/repos/algolia/react-instantsearch/compare/{base}...{head}","merges_url":"https://api.github.com/repos/algolia/react-instantsearch/merges","archive_url":"https://api.github.com/repos/algolia/react-instantsearch/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/algolia/react-instantsearch/downloads","issues_url":"https://api.github.com/repos/algolia/react-instantsearch/issues{/number}","pulls_url":"https://api.github.com/repos/algolia/react-instantsearch/pulls{/number}","milestones_url":"https://api.github.com/repos/algolia/react-instantsearch/milestones{/number}","notifications_url":"https://api.github.com/repos/algolia/react-instantsearch/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/algolia/react-instantsearch/labels{/name}","releases_url":"https://api.github.com/repos/algolia/react-instantsearch/releases{/id}","deployments_url":"https://api.github.com/repos/algolia/react-instantsearch/deployments","created_at":"2017-04-04T11:45:29Z","updated_at":"2017-11-17T15:11:28Z","pushed_at":"2017-11-19T19:21:10Z","git_url":"git://github.com/algolia/react-instantsearch.git","ssh_url":"git@github.com:algolia/react-instantsearch.git","clone_url":"https://github.com/algolia/react-instantsearch.git","svn_url":"https://github.com/algolia/react-instantsearch","homepage":"https://community.algolia.com/react-instantsearch","size":55851,"stargazers_count":274,"watchers_count":274,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":50,"mirror_url":null,"archived":false,"open_issues_count":68,"forks":50,"open_issues":68,"watchers":274,"default_branch":"master"}},"base":{"label":"algolia:master","ref":"master","sha":"19fc562506a5467961cb367b19b59871f7e71331","user":{"login":"algolia","id":2034458,"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":87180009,"name":"react-instantsearch","full_name":"algolia/react-instantsearch","owner":{"login":"algolia","id":2034458,"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},"private":false,"html_url":"https://github.com/algolia/react-instantsearch","description":"⚡ Lightning-fast search for React and React Native apps, by Algolia.","fork":false,"url":"https://api.github.com/repos/algolia/react-instantsearch","forks_url":"https://api.github.com/repos/algolia/react-instantsearch/forks","keys_url":"https://api.github.com/repos/algolia/react-instantsearch/keys{/key_id}","collaborators_url":"https://api.github.com/repos/algolia/react-instantsearch/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/algolia/react-instantsearch/teams","hooks_url":"https://api.github.com/repos/algolia/react-instantsearch/hooks","issue_events_url":"https://api.github.com/repos/algolia/react-instantsearch/issues/events{/number}","events_url":"https://api.github.com/repos/algolia/react-instantsearch/events","assignees_url":"https://api.github.com/repos/algolia/react-instantsearch/assignees{/user}","branches_url":"https://api.github.com/repos/algolia/react-instantsearch/branches{/branch}","tags_url":"https://api.github.com/repos/algolia/react-instantsearch/tags","blobs_url":"https://api.github.com/repos/algolia/react-instantsearch/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/algolia/react-instantsearch/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/algolia/react-instantsearch/git/refs{/sha}","trees_url":"https://api.github.com/repos/algolia/react-instantsearch/git/trees{/sha}","statuses_url":"https://api.github.com/repos/algolia/react-instantsearch/statuses/{sha}","languages_url":"https://api.github.com/repos/algolia/react-instantsearch/languages","stargazers_url":"https://api.github.com/repos/algolia/react-instantsearch/stargazers","contributors_url":"https://api.github.com/repos/algolia/react-instantsearch/contributors","subscribers_url":"https://api.github.com/repos/algolia/react-instantsearch/subscribers","subscription_url":"https://api.github.com/repos/algolia/react-instantsearch/subscription","commits_url":"https://api.github.com/repos/algolia/react-instantsearch/commits{/sha}","git_commits_url":"https://api.github.com/repos/algolia/react-instantsearch/git/commits{/sha}","comments_url":"https://api.github.com/repos/algolia/react-instantsearch/comments{/number}","issue_comment_url":"https://api.github.com/repos/algolia/react-instantsearch/issues/comments{/number}","contents_url":"https://api.github.com/repos/algolia/react-instantsearch/contents/{+path}","compare_url":"https://api.github.com/repos/algolia/react-instantsearch/compare/{base}...{head}","merges_url":"https://api.github.com/repos/algolia/react-instantsearch/merges","archive_url":"https://api.github.com/repos/algolia/react-instantsearch/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/algolia/react-instantsearch/downloads","issues_url":"https://api.github.com/repos/algolia/react-instantsearch/issues{/number}","pulls_url":"https://api.github.com/repos/algolia/react-instantsearch/pulls{/number}","milestones_url":"https://api.github.com/repos/algolia/react-instantsearch/milestones{/number}","notifications_url":"https://api.github.com/repos/algolia/react-instantsearch/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/algolia/react-instantsearch/labels{/name}","releases_url":"https://api.github.com/repos/algolia/react-instantsearch/releases{/id}","deployments_url":"https://api.github.com/repos/algolia/react-instantsearch/deployments","created_at":"2017-04-04T11:45:29Z","updated_at":"2017-11-17T15:11:28Z","pushed_at":"2017-11-19T19:21:10Z","git_url":"git://github.com/algolia/react-instantsearch.git","ssh_url":"git@github.com:algolia/react-instantsearch.git","clone_url":"https://github.com/algolia/react-instantsearch.git","svn_url":"https://github.com/algolia/react-instantsearch","homepage":"https://community.algolia.com/react-instantsearch","size":55851,"stargazers_count":274,"watchers_count":274,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":50,"mirror_url":null,"archived":false,"open_issues_count":68,"forks":50,"open_issues":68,"watchers":274,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/algolia/react-instantsearch/pulls/619"},"html":{"href":"https://github.com/algolia/react-instantsearch/pull/619"},"issue":{"href":"https://api.github.com/repos/algolia/react-instantsearch/issues/619"},"comments":{"href":"https://api.github.com/repos/algolia/react-instantsearch/issues/619/comments"},"review_comments":{"href":"https://api.github.com/repos/algolia/react-instantsearch/pulls/619/comments"},"review_comment":{"href":"https://api.github.com/repos/algolia/react-instantsearch/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/algolia/react-instantsearch/pulls/619/commits"},"statuses":{"href":"https://api.github.com/repos/algolia/react-instantsearch/statuses/72d865c0eaa0d828a44758d987f37f3da3467b03"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"samouss"}}