{"action":"created","comment":{"url":"https://api.github.com/repos/pseudomuto/shopify-api-flux/pulls/comments/39268377","id":39268377,"diff_hunk":"@@ -63,6 +63,17 @@ export default class BaseStore extends Flux.MapStore {\n   }\n \n   /**\n+   * Returns the count for the given query\n+   *\n+   * @param {ResourceQuery} [query]\n+   *\n+   * @return {number}\n+   */\n+  count(query) {","path":"lib/stores/BaseStore.js","position":39,"original_position":39,"commit_id":"89ad6cecb95bae4657ee16e78d2ed29cad034c63","original_commit_id":"89ad6cecb95bae4657ee16e78d2ed29cad034c63","user":{"login":"pseudomuto","id":4748863,"avatar_url":"https://avatars.githubusercontent.com/u/4748863?v=3","gravatar_id":"","url":"https://api.github.com/users/pseudomuto","html_url":"https://github.com/pseudomuto","followers_url":"https://api.github.com/users/pseudomuto/followers","following_url":"https://api.github.com/users/pseudomuto/following{/other_user}","gists_url":"https://api.github.com/users/pseudomuto/gists{/gist_id}","starred_url":"https://api.github.com/users/pseudomuto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pseudomuto/subscriptions","organizations_url":"https://api.github.com/users/pseudomuto/orgs","repos_url":"https://api.github.com/users/pseudomuto/repos","events_url":"https://api.github.com/users/pseudomuto/events{/privacy}","received_events_url":"https://api.github.com/users/pseudomuto/received_events","type":"User","site_admin":false},"body":"With resources this is an opt-in feature. It should be the same for stores, I think","created_at":"2015-09-11T13:03:52Z","updated_at":"2015-09-11T13:03:52Z","html_url":"https://github.com/pseudomuto/shopify-api-flux/pull/45#discussion_r39268377","pull_request_url":"https://api.github.com/repos/pseudomuto/shopify-api-flux/pulls/45","_links":{"self":{"href":"https://api.github.com/repos/pseudomuto/shopify-api-flux/pulls/comments/39268377"},"html":{"href":"https://github.com/pseudomuto/shopify-api-flux/pull/45#discussion_r39268377"},"pull_request":{"href":"https://api.github.com/repos/pseudomuto/shopify-api-flux/pulls/45"}}},"pull_request":{"url":"https://api.github.com/repos/pseudomuto/shopify-api-flux/pulls/45","id":44778527,"html_url":"https://github.com/pseudomuto/shopify-api-flux/pull/45","diff_url":"https://github.com/pseudomuto/shopify-api-flux/pull/45.diff","patch_url":"https://github.com/pseudomuto/shopify-api-flux/pull/45.patch","issue_url":"https://api.github.com/repos/pseudomuto/shopify-api-flux/issues/45","number":45,"state":"open","locked":false,"title":"Countable Things","user":{"login":"pseudomuto","id":4748863,"avatar_url":"https://avatars.githubusercontent.com/u/4748863?v=3","gravatar_id":"","url":"https://api.github.com/users/pseudomuto","html_url":"https://github.com/pseudomuto","followers_url":"https://api.github.com/users/pseudomuto/followers","following_url":"https://api.github.com/users/pseudomuto/following{/other_user}","gists_url":"https://api.github.com/users/pseudomuto/gists{/gist_id}","starred_url":"https://api.github.com/users/pseudomuto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pseudomuto/subscriptions","organizations_url":"https://api.github.com/users/pseudomuto/orgs","repos_url":"https://api.github.com/users/pseudomuto/repos","events_url":"https://api.github.com/users/pseudomuto/events{/privacy}","received_events_url":"https://api.github.com/users/pseudomuto/received_events","type":"User","site_admin":false},"body":"# The Problem\r\n\r\nThe API supports count endpoints for some resources. These endpoints also support filtering via query string parameters.\r\n\r\nCurrently there is no solution for this. While the stores could count the number of items in their local state, we need to be able to count remove records easily.\r\n\r\n# The Solution\r\n\r\nI've added `fetchCount` to the base resource which handles fetching counts from the API. In order to expose this method on the proxies, subclasses should pass `true` for the `countable` parameter on the constructor. (e.g. `super(\"product\", true)`.\r\n\r\nStores also need the ability to supply previously fetched counts. Aside from setting a value (during action handling) and emitting it's change event, the store delegates everything to a `CountStore` instance.\r\n\r\n`CountStore` keeps track of queries and values. It's essentially a wrapper around a map of hashed queries and their associated counts. See the tests for more details.","created_at":"2015-09-11T12:52:01Z","updated_at":"2015-09-11T13:03:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"61b2ebe24033f8c0b1a42f0093b0458d64c7d7cd","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/pseudomuto/shopify-api-flux/pulls/45/commits","review_comments_url":"https://api.github.com/repos/pseudomuto/shopify-api-flux/pulls/45/comments","review_comment_url":"https://api.github.com/repos/pseudomuto/shopify-api-flux/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pseudomuto/shopify-api-flux/issues/45/comments","statuses_url":"https://api.github.com/repos/pseudomuto/shopify-api-flux/statuses/89ad6cecb95bae4657ee16e78d2ed29cad034c63","head":{"label":"pseudomuto:countable_things","ref":"countable_things","sha":"89ad6cecb95bae4657ee16e78d2ed29cad034c63","user":{"login":"pseudomuto","id":4748863,"avatar_url":"https://avatars.githubusercontent.com/u/4748863?v=3","gravatar_id":"","url":"https://api.github.com/users/pseudomuto","html_url":"https://github.com/pseudomuto","followers_url":"https://api.github.com/users/pseudomuto/followers","following_url":"https://api.github.com/users/pseudomuto/following{/other_user}","gists_url":"https://api.github.com/users/pseudomuto/gists{/gist_id}","starred_url":"https://api.github.com/users/pseudomuto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pseudomuto/subscriptions","organizations_url":"https://api.github.com/users/pseudomuto/orgs","repos_url":"https://api.github.com/users/pseudomuto/repos","events_url":"https://api.github.com/users/pseudomuto/events{/privacy}","received_events_url":"https://api.github.com/users/pseudomuto/received_events","type":"User","site_admin":false},"repo":{"id":41512220,"name":"shopify-api-flux","full_name":"pseudomuto/shopify-api-flux","owner":{"login":"pseudomuto","id":4748863,"avatar_url":"https://avatars.githubusercontent.com/u/4748863?v=3","gravatar_id":"","url":"https://api.github.com/users/pseudomuto","html_url":"https://github.com/pseudomuto","followers_url":"https://api.github.com/users/pseudomuto/followers","following_url":"https://api.github.com/users/pseudomuto/following{/other_user}","gists_url":"https://api.github.com/users/pseudomuto/gists{/gist_id}","starred_url":"https://api.github.com/users/pseudomuto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pseudomuto/subscriptions","organizations_url":"https://api.github.com/users/pseudomuto/orgs","repos_url":"https://api.github.com/users/pseudomuto/repos","events_url":"https://api.github.com/users/pseudomuto/events{/privacy}","received_events_url":"https://api.github.com/users/pseudomuto/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/pseudomuto/shopify-api-flux","description":"An implementation of the Shopify API in Flux","fork":false,"url":"https://api.github.com/repos/pseudomuto/shopify-api-flux","forks_url":"https://api.github.com/repos/pseudomuto/shopify-api-flux/forks","keys_url":"https://api.github.com/repos/pseudomuto/shopify-api-flux/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pseudomuto/shopify-api-flux/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pseudomuto/shopify-api-flux/teams","hooks_url":"https://api.github.com/repos/pseudomuto/shopify-api-flux/hooks","issue_events_url":"https://api.github.com/repos/pseudomuto/shopify-api-flux/issues/events{/number}","events_url":"https://api.github.com/repos/pseudomuto/shopify-api-flux/events","assignees_url":"https://api.github.com/repos/pseudomuto/shopify-api-flux/assignees{/user}","branches_url":"https://api.github.com/repos/pseudomuto/shopify-api-flux/branches{/branch}","tags_url":"https://api.github.com/repos/pseudomuto/shopify-api-flux/tags","blobs_url":"https://api.github.com/repos/pseudomuto/shopify-api-flux/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pseudomuto/shopify-api-flux/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pseudomuto/shopify-api-flux/git/refs{/sha}","trees_url":"https://api.github.com/repos/pseudomuto/shopify-api-flux/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pseudomuto/shopify-api-flux/statuses/{sha}","languages_url":"https://api.github.com/repos/pseudomuto/shopify-api-flux/languages","stargazers_url":"https://api.github.com/repos/pseudomuto/shopify-api-flux/stargazers","contributors_url":"https://api.github.com/repos/pseudomuto/shopify-api-flux/contributors","subscribers_url":"https://api.github.com/repos/pseudomuto/shopify-api-flux/subscribers","subscription_url":"https://api.github.com/repos/pseudomuto/shopify-api-flux/subscription","commits_url":"https://api.github.com/repos/pseudomuto/shopify-api-flux/commits{/sha}","git_commits_url":"https://api.github.com/repos/pseudomuto/shopify-api-flux/git/commits{/sha}","comments_url":"https://api.github.com/repos/pseudomuto/shopify-api-flux/comments{/number}","issue_comment_url":"https://api.github.com/repos/pseudomuto/shopify-api-flux/issues/comments{/number}","contents_url":"https://api.github.com/repos/pseudomuto/shopify-api-flux/contents/{+path}","compare_url":"https://api.github.com/repos/pseudomuto/shopify-api-flux/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pseudomuto/shopify-api-flux/merges","archive_url":"https://api.github.com/repos/pseudomuto/shopify-api-flux/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pseudomuto/shopify-api-flux/downloads","issues_url":"https://api.github.com/repos/pseudomuto/shopify-api-flux/issues{/number}","pulls_url":"https://api.github.com/repos/pseudomuto/shopify-api-flux/pulls{/number}","milestones_url":"https://api.github.com/repos/pseudomuto/shopify-api-flux/milestones{/number}","notifications_url":"https://api.github.com/repos/pseudomuto/shopify-api-flux/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pseudomuto/shopify-api-flux/labels{/name}","releases_url":"https://api.github.com/repos/pseudomuto/shopify-api-flux/releases{/id}","created_at":"2015-08-27T21:26:45Z","updated_at":"2015-09-08T00:17:36Z","pushed_at":"2015-09-11T12:52:03Z","git_url":"git://github.com/pseudomuto/shopify-api-flux.git","ssh_url":"git@github.com:pseudomuto/shopify-api-flux.git","clone_url":"https://github.com/pseudomuto/shopify-api-flux.git","svn_url":"https://github.com/pseudomuto/shopify-api-flux","homepage":"http://pseudomuto.com/shopify-api-flux/","size":1352,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":35,"forks":0,"open_issues":35,"watchers":0,"default_branch":"master"}},"base":{"label":"pseudomuto:master","ref":"master","sha":"72addb5a42c69a663825fda2f9cdbffa037eb945","user":{"login":"pseudomuto","id":4748863,"avatar_url":"https://avatars.githubusercontent.com/u/4748863?v=3","gravatar_id":"","url":"https://api.github.com/users/pseudomuto","html_url":"https://github.com/pseudomuto","followers_url":"https://api.github.com/users/pseudomuto/followers","following_url":"https://api.github.com/users/pseudomuto/following{/other_user}","gists_url":"https://api.github.com/users/pseudomuto/gists{/gist_id}","starred_url":"https://api.github.com/users/pseudomuto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pseudomuto/subscriptions","organizations_url":"https://api.github.com/users/pseudomuto/orgs","repos_url":"https://api.github.com/users/pseudomuto/repos","events_url":"https://api.github.com/users/pseudomuto/events{/privacy}","received_events_url":"https://api.github.com/users/pseudomuto/received_events","type":"User","site_admin":false},"repo":{"id":41512220,"name":"shopify-api-flux","full_name":"pseudomuto/shopify-api-flux","owner":{"login":"pseudomuto","id":4748863,"avatar_url":"https://avatars.githubusercontent.com/u/4748863?v=3","gravatar_id":"","url":"https://api.github.com/users/pseudomuto","html_url":"https://github.com/pseudomuto","followers_url":"https://api.github.com/users/pseudomuto/followers","following_url":"https://api.github.com/users/pseudomuto/following{/other_user}","gists_url":"https://api.github.com/users/pseudomuto/gists{/gist_id}","starred_url":"https://api.github.com/users/pseudomuto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pseudomuto/subscriptions","organizations_url":"https://api.github.com/users/pseudomuto/orgs","repos_url":"https://api.github.com/users/pseudomuto/repos","events_url":"https://api.github.com/users/pseudomuto/events{/privacy}","received_events_url":"https://api.github.com/users/pseudomuto/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/pseudomuto/shopify-api-flux","description":"An implementation of the Shopify API in Flux","fork":false,"url":"https://api.github.com/repos/pseudomuto/shopify-api-flux","forks_url":"https://api.github.com/repos/pseudomuto/shopify-api-flux/forks","keys_url":"https://api.github.com/repos/pseudomuto/shopify-api-flux/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pseudomuto/shopify-api-flux/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pseudomuto/shopify-api-flux/teams","hooks_url":"https://api.github.com/repos/pseudomuto/shopify-api-flux/hooks","issue_events_url":"https://api.github.com/repos/pseudomuto/shopify-api-flux/issues/events{/number}","events_url":"https://api.github.com/repos/pseudomuto/shopify-api-flux/events","assignees_url":"https://api.github.com/repos/pseudomuto/shopify-api-flux/assignees{/user}","branches_url":"https://api.github.com/repos/pseudomuto/shopify-api-flux/branches{/branch}","tags_url":"https://api.github.com/repos/pseudomuto/shopify-api-flux/tags","blobs_url":"https://api.github.com/repos/pseudomuto/shopify-api-flux/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pseudomuto/shopify-api-flux/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pseudomuto/shopify-api-flux/git/refs{/sha}","trees_url":"https://api.github.com/repos/pseudomuto/shopify-api-flux/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pseudomuto/shopify-api-flux/statuses/{sha}","languages_url":"https://api.github.com/repos/pseudomuto/shopify-api-flux/languages","stargazers_url":"https://api.github.com/repos/pseudomuto/shopify-api-flux/stargazers","contributors_url":"https://api.github.com/repos/pseudomuto/shopify-api-flux/contributors","subscribers_url":"https://api.github.com/repos/pseudomuto/shopify-api-flux/subscribers","subscription_url":"https://api.github.com/repos/pseudomuto/shopify-api-flux/subscription","commits_url":"https://api.github.com/repos/pseudomuto/shopify-api-flux/commits{/sha}","git_commits_url":"https://api.github.com/repos/pseudomuto/shopify-api-flux/git/commits{/sha}","comments_url":"https://api.github.com/repos/pseudomuto/shopify-api-flux/comments{/number}","issue_comment_url":"https://api.github.com/repos/pseudomuto/shopify-api-flux/issues/comments{/number}","contents_url":"https://api.github.com/repos/pseudomuto/shopify-api-flux/contents/{+path}","compare_url":"https://api.github.com/repos/pseudomuto/shopify-api-flux/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pseudomuto/shopify-api-flux/merges","archive_url":"https://api.github.com/repos/pseudomuto/shopify-api-flux/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pseudomuto/shopify-api-flux/downloads","issues_url":"https://api.github.com/repos/pseudomuto/shopify-api-flux/issues{/number}","pulls_url":"https://api.github.com/repos/pseudomuto/shopify-api-flux/pulls{/number}","milestones_url":"https://api.github.com/repos/pseudomuto/shopify-api-flux/milestones{/number}","notifications_url":"https://api.github.com/repos/pseudomuto/shopify-api-flux/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pseudomuto/shopify-api-flux/labels{/name}","releases_url":"https://api.github.com/repos/pseudomuto/shopify-api-flux/releases{/id}","created_at":"2015-08-27T21:26:45Z","updated_at":"2015-09-08T00:17:36Z","pushed_at":"2015-09-11T12:52:03Z","git_url":"git://github.com/pseudomuto/shopify-api-flux.git","ssh_url":"git@github.com:pseudomuto/shopify-api-flux.git","clone_url":"https://github.com/pseudomuto/shopify-api-flux.git","svn_url":"https://github.com/pseudomuto/shopify-api-flux","homepage":"http://pseudomuto.com/shopify-api-flux/","size":1352,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":35,"forks":0,"open_issues":35,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pseudomuto/shopify-api-flux/pulls/45"},"html":{"href":"https://github.com/pseudomuto/shopify-api-flux/pull/45"},"issue":{"href":"https://api.github.com/repos/pseudomuto/shopify-api-flux/issues/45"},"comments":{"href":"https://api.github.com/repos/pseudomuto/shopify-api-flux/issues/45/comments"},"review_comments":{"href":"https://api.github.com/repos/pseudomuto/shopify-api-flux/pulls/45/comments"},"review_comment":{"href":"https://api.github.com/repos/pseudomuto/shopify-api-flux/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pseudomuto/shopify-api-flux/pulls/45/commits"},"statuses":{"href":"https://api.github.com/repos/pseudomuto/shopify-api-flux/statuses/89ad6cecb95bae4657ee16e78d2ed29cad034c63"}}}}