{"action":"created","comment":{"url":"https://api.github.com/repos/algolia/instantsearch.js/pulls/comments/44124075","id":44124075,"diff_hunk":"@@ -0,0 +1,95 @@\n+let React = require('react');\n+let ReactDOM = require('react-dom');\n+\n+let {bemHelper, getContainerNode, prepareTemplateProps} = require('../../lib/utils.js');\n+let bem = bemHelper('ais-clear-all');\n+let cx = require('classnames');\n+\n+let autoHideContainer = require('../../decorators/autoHideContainer');\n+let headerFooter = require('../../decorators/headerFooter');\n+\n+let isEmpty = require('lodash/lang/isEmpty');\n+\n+let defaultTemplates = require('./defaultTemplates');\n+\n+/**\n+ * Allows to clear all refinements at once\n+ * @param  {string|DOMElement} options.container CSS Selector or DOMElement to insert the widget\n+ * @param  {Object} [options.cssClasses] CSS classes to add\n+ * @param  {string|string[]} [options.cssClasses.root] CSS class to add to the root element\n+ * @param  {string|string[]} [options.cssClasses.header] CSS class to add to the header element\n+ * @param  {string|string[]} [options.cssClasses.body] CSS class to add to the body element\n+ * @param  {string|string[]} [options.cssClasses.footer] CSS class to add to the footer element\n+ * @param  {string|string[]} [options.cssClasses.link] CSS class to add to the link element\n+ * @param  {Object} [options.templates] Templates to use for the widget\n+ * @param  {string|Function} [options.templates.header=''] Header template\n+ * @param  {string|Function} [options.templates.link] Link template\n+ * @param  {string|Function} [options.templates.footer=''] Footer template\n+ * @param  {boolean} [options.autoHideContainer=true] Hide the container when there's no refinement to clear\n+ * @return {Object}\n+ */\n+function clearAll({\n+    container,\n+    templates = defaultTemplates,\n+    cssClasses: userCssClasses = {},\n+    autoHideContainer: doAutoHideContainer = true\n+  } = {}) {\n+  let containerNode = getContainerNode(container);\n+  let usage = 'Usage: toggle({container[, cssClasses.{root,header,body,footer,link}, templates.{header,link,footer}, autoHideContainer]})';\n+\n+  let ClearAll = headerFooter(require('../../components/ClearAll/ClearAll.js'));","path":"widgets/clear-all/clear-all.js","position":40,"original_position":40,"commit_id":"5190a10400a9b6152f897a2079ad6e768b467957","original_commit_id":"5190a10400a9b6152f897a2079ad6e768b467957","user":{"login":"Jerskouille","id":5095856,"avatar_url":"https://avatars.githubusercontent.com/u/5095856?v=3","gravatar_id":"","url":"https://api.github.com/users/Jerskouille","html_url":"https://github.com/Jerskouille","followers_url":"https://api.github.com/users/Jerskouille/followers","following_url":"https://api.github.com/users/Jerskouille/following{/other_user}","gists_url":"https://api.github.com/users/Jerskouille/gists{/gist_id}","starred_url":"https://api.github.com/users/Jerskouille/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Jerskouille/subscriptions","organizations_url":"https://api.github.com/users/Jerskouille/orgs","repos_url":"https://api.github.com/users/Jerskouille/repos","events_url":"https://api.github.com/users/Jerskouille/events{/privacy}","received_events_url":"https://api.github.com/users/Jerskouille/received_events","type":"User","site_admin":false},"body":"I'd say yes because it can definetely be included in the side bar with other facets widgets and you might want to style them all the same way.","created_at":"2015-11-06T10:42:06Z","updated_at":"2015-11-06T10:42:06Z","html_url":"https://github.com/algolia/instantsearch.js/pull/427#discussion_r44124075","pull_request_url":"https://api.github.com/repos/algolia/instantsearch.js/pulls/427","_links":{"self":{"href":"https://api.github.com/repos/algolia/instantsearch.js/pulls/comments/44124075"},"html":{"href":"https://github.com/algolia/instantsearch.js/pull/427#discussion_r44124075"},"pull_request":{"href":"https://api.github.com/repos/algolia/instantsearch.js/pulls/427"}}},"pull_request":{"url":"https://api.github.com/repos/algolia/instantsearch.js/pulls/427","id":49535552,"html_url":"https://github.com/algolia/instantsearch.js/pull/427","diff_url":"https://github.com/algolia/instantsearch.js/pull/427.diff","patch_url":"https://github.com/algolia/instantsearch.js/pull/427.patch","issue_url":"https://api.github.com/repos/algolia/instantsearch.js/issues/427","number":427,"state":"open","locked":false,"title":"feat(clearAll): New widget","user":{"login":"Jerskouille","id":5095856,"avatar_url":"https://avatars.githubusercontent.com/u/5095856?v=3","gravatar_id":"","url":"https://api.github.com/users/Jerskouille","html_url":"https://github.com/Jerskouille","followers_url":"https://api.github.com/users/Jerskouille/followers","following_url":"https://api.github.com/users/Jerskouille/following{/other_user}","gists_url":"https://api.github.com/users/Jerskouille/gists{/gist_id}","starred_url":"https://api.github.com/users/Jerskouille/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Jerskouille/subscriptions","organizations_url":"https://api.github.com/users/Jerskouille/orgs","repos_url":"https://api.github.com/users/Jerskouille/repos","events_url":"https://api.github.com/users/Jerskouille/events{/privacy}","received_events_url":"https://api.github.com/users/Jerskouille/received_events","type":"User","site_admin":false},"body":"Uses #407 's `autoHideContainer` instead of `hideContainerWhenNoResults`. We might want to wait until this is implemented in all widgets before merging.\r\n\r\nCloses #405","created_at":"2015-11-03T09:51:28Z","updated_at":"2015-11-06T10:42:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"32bd3e2b81d728f36a6b163c180bf64267df5c30","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/algolia/instantsearch.js/pulls/427/commits","review_comments_url":"https://api.github.com/repos/algolia/instantsearch.js/pulls/427/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/427/comments","statuses_url":"https://api.github.com/repos/algolia/instantsearch.js/statuses/5190a10400a9b6152f897a2079ad6e768b467957","head":{"label":"algolia:feat/clearAll","ref":"feat/clearAll","sha":"5190a10400a9b6152f897a2079ad6e768b467957","user":{"login":"algolia","id":2034458,"avatar_url":"https://avatars.githubusercontent.com/u/2034458?v=3","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,"name":"instantsearch.js","full_name":"algolia/instantsearch.js","owner":{"login":"algolia","id":2034458,"avatar_url":"https://avatars.githubusercontent.com/u/2034458?v=3","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/instantsearch.js","description":"instantsearch.js is a library of widgets to build high performance instant search experiences using 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}","created_at":"2015-07-21T12:10:27Z","updated_at":"2015-11-05T22:28:21Z","pushed_at":"2015-11-06T10:14:29Z","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":"","size":6740,"stargazers_count":27,"watchers_count":27,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":59,"forks":2,"open_issues":59,"watchers":27,"default_branch":"master"}},"base":{"label":"algolia:develop","ref":"develop","sha":"1d6a92f940d84ffc8ecfe7e924ffb51f6f29e9a2","user":{"login":"algolia","id":2034458,"avatar_url":"https://avatars.githubusercontent.com/u/2034458?v=3","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,"name":"instantsearch.js","full_name":"algolia/instantsearch.js","owner":{"login":"algolia","id":2034458,"avatar_url":"https://avatars.githubusercontent.com/u/2034458?v=3","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/instantsearch.js","description":"instantsearch.js is a library of widgets to build high performance instant search experiences using 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}","created_at":"2015-07-21T12:10:27Z","updated_at":"2015-11-05T22:28:21Z","pushed_at":"2015-11-06T10:14:29Z","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":"","size":6740,"stargazers_count":27,"watchers_count":27,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":59,"forks":2,"open_issues":59,"watchers":27,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/algolia/instantsearch.js/pulls/427"},"html":{"href":"https://github.com/algolia/instantsearch.js/pull/427"},"issue":{"href":"https://api.github.com/repos/algolia/instantsearch.js/issues/427"},"comments":{"href":"https://api.github.com/repos/algolia/instantsearch.js/issues/427/comments"},"review_comments":{"href":"https://api.github.com/repos/algolia/instantsearch.js/pulls/427/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/427/commits"},"statuses":{"href":"https://api.github.com/repos/algolia/instantsearch.js/statuses/5190a10400a9b6152f897a2079ad6e768b467957"}}}}