{"action":"created","issue":{"url":"https://api.github.com/repos/algolia/react-instantsearch/issues/70","repository_url":"https://api.github.com/repos/algolia/react-instantsearch","labels_url":"https://api.github.com/repos/algolia/react-instantsearch/issues/70/labels{/name}","comments_url":"https://api.github.com/repos/algolia/react-instantsearch/issues/70/comments","events_url":"https://api.github.com/repos/algolia/react-instantsearch/issues/70/events","html_url":"https://github.com/algolia/react-instantsearch/pull/70","id":224829033,"number":70,"title":"fix(core/InstantSearch): update algoliaClient when it change","user":{"login":"Mystraht","id":8995312,"avatar_url":"https://avatars0.githubusercontent.com/u/8995312?v=3","gravatar_id":"","url":"https://api.github.com/users/Mystraht","html_url":"https://github.com/Mystraht","followers_url":"https://api.github.com/users/Mystraht/followers","following_url":"https://api.github.com/users/Mystraht/following{/other_user}","gists_url":"https://api.github.com/users/Mystraht/gists{/gist_id}","starred_url":"https://api.github.com/users/Mystraht/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mystraht/subscriptions","organizations_url":"https://api.github.com/users/Mystraht/orgs","repos_url":"https://api.github.com/users/Mystraht/repos","events_url":"https://api.github.com/users/Mystraht/events{/privacy}","received_events_url":"https://api.github.com/users/Mystraht/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-04-27T15:49:32Z","updated_at":"2017-04-28T09:39:20Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/algolia/react-instantsearch/pulls/70","html_url":"https://github.com/algolia/react-instantsearch/pull/70","diff_url":"https://github.com/algolia/react-instantsearch/pull/70.diff","patch_url":"https://github.com/algolia/react-instantsearch/pull/70.patch"},"body":"**Summary**\r\n\r\nApiKey parameter is not changed in search query when InstantSearch component is updated with new apiKey props.\r\nAlgolia client is updated with new values if appId or apiKey is changed (at createInstantSearch.js:39) but helper in InstantSearchManager (created in InstantSearch component) is not updated.\r\n\r\n**Result**\r\n\r\nI created component that render InstantSearch with apiKey \"exampleApiKey1\" then i changed component state (with setTimeout for the example) to render InstantSearch again but with a new apiKey props. (exampleApiKey2)\r\n\r\nWithout my fix, ajax call is always called with exampleApiKey1\r\n\r\nhttp://image.prntscr.com/image/c5a1670088ad4e7b9edfaff72ec9479b.png\r\n\r\nWith my fix, ajax get is called with exampleApiKey1 then exampleApiKey2 after rendering with the new props (see screens)\r\n\r\nhttp://image.prntscr.com/image/a68d4384ff16488f83813e98b91478cb.png\r\n\r\nThanks"},"comment":{"url":"https://api.github.com/repos/algolia/react-instantsearch/issues/comments/297954883","html_url":"https://github.com/algolia/react-instantsearch/pull/70#issuecomment-297954883","issue_url":"https://api.github.com/repos/algolia/react-instantsearch/issues/70","id":297954883,"user":{"login":"mthuret","id":6885378,"avatar_url":"https://avatars3.githubusercontent.com/u/6885378?v=3","gravatar_id":"","url":"https://api.github.com/users/mthuret","html_url":"https://github.com/mthuret","followers_url":"https://api.github.com/users/mthuret/followers","following_url":"https://api.github.com/users/mthuret/following{/other_user}","gists_url":"https://api.github.com/users/mthuret/gists{/gist_id}","starred_url":"https://api.github.com/users/mthuret/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mthuret/subscriptions","organizations_url":"https://api.github.com/users/mthuret/orgs","repos_url":"https://api.github.com/users/mthuret/repos","events_url":"https://api.github.com/users/mthuret/events{/privacy}","received_events_url":"https://api.github.com/users/mthuret/received_events","type":"User","site_admin":false},"created_at":"2017-04-28T09:39:20Z","updated_at":"2017-04-28T09:39:20Z","body":"@Mystraht Thank you for your contribution :)"}}
{"actor":{"display_login":"mthuret"}}