{"action":"created","issue":{"url":"https://api.github.com/repos/Automattic/wp-calypso/issues/6082","repository_url":"https://api.github.com/repos/Automattic/wp-calypso","labels_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/6082/labels{/name}","comments_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/6082/comments","events_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/6082/events","html_url":"https://github.com/Automattic/wp-calypso/pull/6082","id":160645755,"number":6082,"title":"Add getSitePlan and isCurrentSitePlan selectors with tests","user":{"login":"lamosty","id":4988512,"avatar_url":"https://avatars.githubusercontent.com/u/4988512?v=3","gravatar_id":"","url":"https://api.github.com/users/lamosty","html_url":"https://github.com/lamosty","followers_url":"https://api.github.com/users/lamosty/followers","following_url":"https://api.github.com/users/lamosty/following{/other_user}","gists_url":"https://api.github.com/users/lamosty/gists{/gist_id}","starred_url":"https://api.github.com/users/lamosty/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lamosty/subscriptions","organizations_url":"https://api.github.com/users/lamosty/orgs","repos_url":"https://api.github.com/users/lamosty/repos","events_url":"https://api.github.com/users/lamosty/events{/privacy}","received_events_url":"https://api.github.com/users/lamosty/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Automattic/wp-calypso/labels/Plans","name":"Plans","color":"006b75"},{"url":"https://api.github.com/repos/Automattic/wp-calypso/labels/[Status]%20Ready%20to%20Merge","name":"[Status] Ready to Merge","color":"d4fb79"}],"state":"open","locked":false,"assignee":{"login":"lamosty","id":4988512,"avatar_url":"https://avatars.githubusercontent.com/u/4988512?v=3","gravatar_id":"","url":"https://api.github.com/users/lamosty","html_url":"https://github.com/lamosty","followers_url":"https://api.github.com/users/lamosty/followers","following_url":"https://api.github.com/users/lamosty/following{/other_user}","gists_url":"https://api.github.com/users/lamosty/gists{/gist_id}","starred_url":"https://api.github.com/users/lamosty/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lamosty/subscriptions","organizations_url":"https://api.github.com/users/lamosty/orgs","repos_url":"https://api.github.com/users/lamosty/repos","events_url":"https://api.github.com/users/lamosty/events{/privacy}","received_events_url":"https://api.github.com/users/lamosty/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/Automattic/wp-calypso/milestones/89","html_url":"https://github.com/Automattic/wp-calypso/milestones/Plans:%20Maintenance","labels_url":"https://api.github.com/repos/Automattic/wp-calypso/milestones/89/labels","id":1768456,"number":89,"title":"Plans: Maintenance","description":"","creator":{"login":"fabianapsimoes","id":1248436,"avatar_url":"https://avatars.githubusercontent.com/u/1248436?v=3","gravatar_id":"","url":"https://api.github.com/users/fabianapsimoes","html_url":"https://github.com/fabianapsimoes","followers_url":"https://api.github.com/users/fabianapsimoes/followers","following_url":"https://api.github.com/users/fabianapsimoes/following{/other_user}","gists_url":"https://api.github.com/users/fabianapsimoes/gists{/gist_id}","starred_url":"https://api.github.com/users/fabianapsimoes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fabianapsimoes/subscriptions","organizations_url":"https://api.github.com/users/fabianapsimoes/orgs","repos_url":"https://api.github.com/users/fabianapsimoes/repos","events_url":"https://api.github.com/users/fabianapsimoes/events{/privacy}","received_events_url":"https://api.github.com/users/fabianapsimoes/received_events","type":"User","site_admin":false},"open_issues":30,"closed_issues":31,"state":"open","created_at":"2016-05-16T10:50:24Z","updated_at":"2016-06-16T12:07:09Z","due_on":null,"closed_at":null},"comments":2,"created_at":"2016-06-16T12:07:08Z","updated_at":"2016-06-16T19:44:18Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/6082","html_url":"https://github.com/Automattic/wp-calypso/pull/6082","diff_url":"https://github.com/Automattic/wp-calypso/pull/6082.diff","patch_url":"https://github.com/Automattic/wp-calypso/pull/6082.patch"},"body":"Add brand new selectors for easier manipulation of site's currently subscribed plan. With these selectors, we can avoid using the `/sites/$site/plans` endpoint and `state/sites/plans` for some use cases, namely the redesigned plan components in #6002.\r\n\r\n## getSitePlan\r\n\r\n`getSitePlan` returns the plan to which the site is currently subscribed. Use instead of `getCurrentPlan` from `state/sites/plans/selectors` if the following properties are enough for you:\r\n\r\n![selection_019](https://cloud.githubusercontent.com/assets/4988512/16116763/fffcee52-33ce-11e6-86a5-9e09cf279546.jpg)\r\n\r\n## isCurrentSitePlan\r\n\r\n`isCurrentSitePlan` returns `true` if the supplied `planProductId` matches the `product_id` of the site's currently subscribed plan. Use instead of `current_plan` from `getCurrentPlan`.\r\n\r\ncc @gwwar @aduth \r\n\r\nTest live: https://calypso.live/?branch=add/getSitePlan-selector"},"comment":{"url":"https://api.github.com/repos/Automattic/wp-calypso/issues/comments/226592434","html_url":"https://github.com/Automattic/wp-calypso/pull/6082#issuecomment-226592434","issue_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/6082","id":226592434,"user":{"login":"lamosty","id":4988512,"avatar_url":"https://avatars.githubusercontent.com/u/4988512?v=3","gravatar_id":"","url":"https://api.github.com/users/lamosty","html_url":"https://github.com/lamosty","followers_url":"https://api.github.com/users/lamosty/followers","following_url":"https://api.github.com/users/lamosty/following{/other_user}","gists_url":"https://api.github.com/users/lamosty/gists{/gist_id}","starred_url":"https://api.github.com/users/lamosty/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lamosty/subscriptions","organizations_url":"https://api.github.com/users/lamosty/orgs","repos_url":"https://api.github.com/users/lamosty/repos","events_url":"https://api.github.com/users/lamosty/events{/privacy}","received_events_url":"https://api.github.com/users/lamosty/received_events","type":"User","site_admin":false},"created_at":"2016-06-16T19:44:18Z","updated_at":"2016-06-16T19:44:18Z","body":"Thanks for the reviews!"}}
{"actor":{"display_login":"lamosty"}}