{"action":"created","comment":{"url":"https://api.github.com/repos/RackSec/wilson/pulls/comments/61794804","id":61794804,"diff_hunk":"@@ -78,6 +79,48 @@\n   ([ks rows]\n    (table ks rows {})))\n \n+\n+(defn sorted-table\n+  \"Returns a sortable table (using `wilson.dom/table`) with rows sorted using\n+  `wilson.dom/sort-rows`. Table headers will have an on-click handler that\n+  will change the sorting key and/or order (those values are saved under\n+  unique names in the passed state). You can pass the same options map that\n+  `wilson.dom/table` would accept. In addition, you can extend options map\n+  with `:sort-fns` - its value will get passed directly to\n+  `wilson.dom/sort-rows.\"\n+  ([ks rows state opts]\n+   (let [sort-key-id (gensym \"wilson-order-key\")\n+         sort-order-id (gensym \"wilson-order-key\")]\n+     (swap! state merge {sort-key-id (first ks)\n+                         sort-order-id :asc})\n+     (fn []\n+       (let [state-deref @state\n+             sort-fns (or (:sort-fns opts)\n+                      {:default (fn [k rows]","path":"src/wilson/dom.cljs","position":null,"original_position":31,"commit_id":"47323b9ef195b3337f0c028ae24ea2ee7c4a8bf1","original_commit_id":"51f012a072efbdac063d5d6d849625afd95a493e","user":{"login":"lvh","id":97816,"avatar_url":"https://avatars.githubusercontent.com/u/97816?v=3","gravatar_id":"","url":"https://api.github.com/users/lvh","html_url":"https://github.com/lvh","followers_url":"https://api.github.com/users/lvh/followers","following_url":"https://api.github.com/users/lvh/following{/other_user}","gists_url":"https://api.github.com/users/lvh/gists{/gist_id}","starred_url":"https://api.github.com/users/lvh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lvh/subscriptions","organizations_url":"https://api.github.com/users/lvh/orgs","repos_url":"https://api.github.com/users/lvh/repos","events_url":"https://api.github.com/users/lvh/events{/privacy}","received_events_url":"https://api.github.com/users/lvh/received_events","type":"User","site_admin":false},"body":"just that we have lots of projects and therefore don't consistently apply linters","created_at":"2016-05-02T20:04:47Z","updated_at":"2016-05-02T20:04:47Z","html_url":"https://github.com/RackSec/wilson/pull/11#discussion_r61794804","pull_request_url":"https://api.github.com/repos/RackSec/wilson/pulls/11","_links":{"self":{"href":"https://api.github.com/repos/RackSec/wilson/pulls/comments/61794804"},"html":{"href":"https://github.com/RackSec/wilson/pull/11#discussion_r61794804"},"pull_request":{"href":"https://api.github.com/repos/RackSec/wilson/pulls/11"}}},"pull_request":{"url":"https://api.github.com/repos/RackSec/wilson/pulls/11","id":68236909,"html_url":"https://github.com/RackSec/wilson/pull/11","diff_url":"https://github.com/RackSec/wilson/pull/11.diff","patch_url":"https://github.com/RackSec/wilson/pull/11.patch","issue_url":"https://api.github.com/repos/RackSec/wilson/issues/11","number":11,"state":"open","locked":false,"title":"Sorted table component","user":{"login":"smogg","id":1500714,"avatar_url":"https://avatars.githubusercontent.com/u/1500714?v=3","gravatar_id":"","url":"https://api.github.com/users/smogg","html_url":"https://github.com/smogg","followers_url":"https://api.github.com/users/smogg/followers","following_url":"https://api.github.com/users/smogg/following{/other_user}","gists_url":"https://api.github.com/users/smogg/gists{/gist_id}","starred_url":"https://api.github.com/users/smogg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smogg/subscriptions","organizations_url":"https://api.github.com/users/smogg/orgs","repos_url":"https://api.github.com/users/smogg/repos","events_url":"https://api.github.com/users/smogg/events{/privacy}","received_events_url":"https://api.github.com/users/smogg/received_events","type":"User","site_admin":false},"body":"*WIP*","created_at":"2016-04-28T15:06:32Z","updated_at":"2016-05-02T20:04:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"213d3e8bcc63c0cb1233437369c83d02579aff14","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/RackSec/wilson/pulls/11/commits","review_comments_url":"https://api.github.com/repos/RackSec/wilson/pulls/11/comments","review_comment_url":"https://api.github.com/repos/RackSec/wilson/pulls/comments{/number}","comments_url":"https://api.github.com/repos/RackSec/wilson/issues/11/comments","statuses_url":"https://api.github.com/repos/RackSec/wilson/statuses/47323b9ef195b3337f0c028ae24ea2ee7c4a8bf1","head":{"label":"smogg:sorted-table-component","ref":"sorted-table-component","sha":"47323b9ef195b3337f0c028ae24ea2ee7c4a8bf1","user":{"login":"smogg","id":1500714,"avatar_url":"https://avatars.githubusercontent.com/u/1500714?v=3","gravatar_id":"","url":"https://api.github.com/users/smogg","html_url":"https://github.com/smogg","followers_url":"https://api.github.com/users/smogg/followers","following_url":"https://api.github.com/users/smogg/following{/other_user}","gists_url":"https://api.github.com/users/smogg/gists{/gist_id}","starred_url":"https://api.github.com/users/smogg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smogg/subscriptions","organizations_url":"https://api.github.com/users/smogg/orgs","repos_url":"https://api.github.com/users/smogg/repos","events_url":"https://api.github.com/users/smogg/events{/privacy}","received_events_url":"https://api.github.com/users/smogg/received_events","type":"User","site_admin":false},"repo":{"id":43560438,"name":"wilson","full_name":"smogg/wilson","owner":{"login":"smogg","id":1500714,"avatar_url":"https://avatars.githubusercontent.com/u/1500714?v=3","gravatar_id":"","url":"https://api.github.com/users/smogg","html_url":"https://github.com/smogg","followers_url":"https://api.github.com/users/smogg/followers","following_url":"https://api.github.com/users/smogg/following{/other_user}","gists_url":"https://api.github.com/users/smogg/gists{/gist_id}","starred_url":"https://api.github.com/users/smogg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smogg/subscriptions","organizations_url":"https://api.github.com/users/smogg/orgs","repos_url":"https://api.github.com/users/smogg/repos","events_url":"https://api.github.com/users/smogg/events{/privacy}","received_events_url":"https://api.github.com/users/smogg/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/smogg/wilson","description":"Opinionated Reagent tools for Bootstrap","fork":true,"url":"https://api.github.com/repos/smogg/wilson","forks_url":"https://api.github.com/repos/smogg/wilson/forks","keys_url":"https://api.github.com/repos/smogg/wilson/keys{/key_id}","collaborators_url":"https://api.github.com/repos/smogg/wilson/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/smogg/wilson/teams","hooks_url":"https://api.github.com/repos/smogg/wilson/hooks","issue_events_url":"https://api.github.com/repos/smogg/wilson/issues/events{/number}","events_url":"https://api.github.com/repos/smogg/wilson/events","assignees_url":"https://api.github.com/repos/smogg/wilson/assignees{/user}","branches_url":"https://api.github.com/repos/smogg/wilson/branches{/branch}","tags_url":"https://api.github.com/repos/smogg/wilson/tags","blobs_url":"https://api.github.com/repos/smogg/wilson/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/smogg/wilson/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/smogg/wilson/git/refs{/sha}","trees_url":"https://api.github.com/repos/smogg/wilson/git/trees{/sha}","statuses_url":"https://api.github.com/repos/smogg/wilson/statuses/{sha}","languages_url":"https://api.github.com/repos/smogg/wilson/languages","stargazers_url":"https://api.github.com/repos/smogg/wilson/stargazers","contributors_url":"https://api.github.com/repos/smogg/wilson/contributors","subscribers_url":"https://api.github.com/repos/smogg/wilson/subscribers","subscription_url":"https://api.github.com/repos/smogg/wilson/subscription","commits_url":"https://api.github.com/repos/smogg/wilson/commits{/sha}","git_commits_url":"https://api.github.com/repos/smogg/wilson/git/commits{/sha}","comments_url":"https://api.github.com/repos/smogg/wilson/comments{/number}","issue_comment_url":"https://api.github.com/repos/smogg/wilson/issues/comments{/number}","contents_url":"https://api.github.com/repos/smogg/wilson/contents/{+path}","compare_url":"https://api.github.com/repos/smogg/wilson/compare/{base}...{head}","merges_url":"https://api.github.com/repos/smogg/wilson/merges","archive_url":"https://api.github.com/repos/smogg/wilson/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/smogg/wilson/downloads","issues_url":"https://api.github.com/repos/smogg/wilson/issues{/number}","pulls_url":"https://api.github.com/repos/smogg/wilson/pulls{/number}","milestones_url":"https://api.github.com/repos/smogg/wilson/milestones{/number}","notifications_url":"https://api.github.com/repos/smogg/wilson/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/smogg/wilson/labels{/name}","releases_url":"https://api.github.com/repos/smogg/wilson/releases{/id}","deployments_url":"https://api.github.com/repos/smogg/wilson/deployments","created_at":"2015-10-02T15:26:24Z","updated_at":"2015-10-02T15:26:25Z","pushed_at":"2016-05-02T17:00:52Z","git_url":"git://github.com/smogg/wilson.git","ssh_url":"git@github.com:smogg/wilson.git","clone_url":"https://github.com/smogg/wilson.git","svn_url":"https://github.com/smogg/wilson","homepage":null,"size":129,"stargazers_count":0,"watchers_count":0,"language":"Clojure","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"RackSec:master","ref":"master","sha":"381d917acc24e9f17a5ae117c707a3b229a4a430","user":{"login":"RackSec","id":12700871,"avatar_url":"https://avatars.githubusercontent.com/u/12700871?v=3","gravatar_id":"","url":"https://api.github.com/users/RackSec","html_url":"https://github.com/RackSec","followers_url":"https://api.github.com/users/RackSec/followers","following_url":"https://api.github.com/users/RackSec/following{/other_user}","gists_url":"https://api.github.com/users/RackSec/gists{/gist_id}","starred_url":"https://api.github.com/users/RackSec/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RackSec/subscriptions","organizations_url":"https://api.github.com/users/RackSec/orgs","repos_url":"https://api.github.com/users/RackSec/repos","events_url":"https://api.github.com/users/RackSec/events{/privacy}","received_events_url":"https://api.github.com/users/RackSec/received_events","type":"Organization","site_admin":false},"repo":{"id":37516320,"name":"wilson","full_name":"RackSec/wilson","owner":{"login":"RackSec","id":12700871,"avatar_url":"https://avatars.githubusercontent.com/u/12700871?v=3","gravatar_id":"","url":"https://api.github.com/users/RackSec","html_url":"https://github.com/RackSec","followers_url":"https://api.github.com/users/RackSec/followers","following_url":"https://api.github.com/users/RackSec/following{/other_user}","gists_url":"https://api.github.com/users/RackSec/gists{/gist_id}","starred_url":"https://api.github.com/users/RackSec/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RackSec/subscriptions","organizations_url":"https://api.github.com/users/RackSec/orgs","repos_url":"https://api.github.com/users/RackSec/repos","events_url":"https://api.github.com/users/RackSec/events{/privacy}","received_events_url":"https://api.github.com/users/RackSec/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/RackSec/wilson","description":"Opinionated Reagent tools for Bootstrap","fork":false,"url":"https://api.github.com/repos/RackSec/wilson","forks_url":"https://api.github.com/repos/RackSec/wilson/forks","keys_url":"https://api.github.com/repos/RackSec/wilson/keys{/key_id}","collaborators_url":"https://api.github.com/repos/RackSec/wilson/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/RackSec/wilson/teams","hooks_url":"https://api.github.com/repos/RackSec/wilson/hooks","issue_events_url":"https://api.github.com/repos/RackSec/wilson/issues/events{/number}","events_url":"https://api.github.com/repos/RackSec/wilson/events","assignees_url":"https://api.github.com/repos/RackSec/wilson/assignees{/user}","branches_url":"https://api.github.com/repos/RackSec/wilson/branches{/branch}","tags_url":"https://api.github.com/repos/RackSec/wilson/tags","blobs_url":"https://api.github.com/repos/RackSec/wilson/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/RackSec/wilson/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/RackSec/wilson/git/refs{/sha}","trees_url":"https://api.github.com/repos/RackSec/wilson/git/trees{/sha}","statuses_url":"https://api.github.com/repos/RackSec/wilson/statuses/{sha}","languages_url":"https://api.github.com/repos/RackSec/wilson/languages","stargazers_url":"https://api.github.com/repos/RackSec/wilson/stargazers","contributors_url":"https://api.github.com/repos/RackSec/wilson/contributors","subscribers_url":"https://api.github.com/repos/RackSec/wilson/subscribers","subscription_url":"https://api.github.com/repos/RackSec/wilson/subscription","commits_url":"https://api.github.com/repos/RackSec/wilson/commits{/sha}","git_commits_url":"https://api.github.com/repos/RackSec/wilson/git/commits{/sha}","comments_url":"https://api.github.com/repos/RackSec/wilson/comments{/number}","issue_comment_url":"https://api.github.com/repos/RackSec/wilson/issues/comments{/number}","contents_url":"https://api.github.com/repos/RackSec/wilson/contents/{+path}","compare_url":"https://api.github.com/repos/RackSec/wilson/compare/{base}...{head}","merges_url":"https://api.github.com/repos/RackSec/wilson/merges","archive_url":"https://api.github.com/repos/RackSec/wilson/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/RackSec/wilson/downloads","issues_url":"https://api.github.com/repos/RackSec/wilson/issues{/number}","pulls_url":"https://api.github.com/repos/RackSec/wilson/pulls{/number}","milestones_url":"https://api.github.com/repos/RackSec/wilson/milestones{/number}","notifications_url":"https://api.github.com/repos/RackSec/wilson/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/RackSec/wilson/labels{/name}","releases_url":"https://api.github.com/repos/RackSec/wilson/releases{/id}","deployments_url":"https://api.github.com/repos/RackSec/wilson/deployments","created_at":"2015-06-16T07:56:58Z","updated_at":"2016-01-13T21:40:42Z","pushed_at":"2016-05-02T19:23:48Z","git_url":"git://github.com/RackSec/wilson.git","ssh_url":"git@github.com:RackSec/wilson.git","clone_url":"https://github.com/RackSec/wilson.git","svn_url":"https://github.com/RackSec/wilson","homepage":null,"size":132,"stargazers_count":1,"watchers_count":1,"language":"Clojure","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":4,"forks":2,"open_issues":4,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/RackSec/wilson/pulls/11"},"html":{"href":"https://github.com/RackSec/wilson/pull/11"},"issue":{"href":"https://api.github.com/repos/RackSec/wilson/issues/11"},"comments":{"href":"https://api.github.com/repos/RackSec/wilson/issues/11/comments"},"review_comments":{"href":"https://api.github.com/repos/RackSec/wilson/pulls/11/comments"},"review_comment":{"href":"https://api.github.com/repos/RackSec/wilson/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/RackSec/wilson/pulls/11/commits"},"statuses":{"href":"https://api.github.com/repos/RackSec/wilson/statuses/47323b9ef195b3337f0c028ae24ea2ee7c4a8bf1"}}}}