{"action":"created","issue":{"url":"https://api.github.com/repos/mattkrick/cashay/issues/112","repository_url":"https://api.github.com/repos/mattkrick/cashay","labels_url":"https://api.github.com/repos/mattkrick/cashay/issues/112/labels{/name}","comments_url":"https://api.github.com/repos/mattkrick/cashay/issues/112/comments","events_url":"https://api.github.com/repos/mattkrick/cashay/issues/112/events","html_url":"https://github.com/mattkrick/cashay/issues/112","id":172945298,"number":112,"title":"Write @live directive","user":{"login":"mattkrick","id":5514175,"avatar_url":"https://avatars.githubusercontent.com/u/5514175?v=3","gravatar_id":"","url":"https://api.github.com/users/mattkrick","html_url":"https://github.com/mattkrick","followers_url":"https://api.github.com/users/mattkrick/followers","following_url":"https://api.github.com/users/mattkrick/following{/other_user}","gists_url":"https://api.github.com/users/mattkrick/gists{/gist_id}","starred_url":"https://api.github.com/users/mattkrick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattkrick/subscriptions","organizations_url":"https://api.github.com/users/mattkrick/orgs","repos_url":"https://api.github.com/users/mattkrick/repos","events_url":"https://api.github.com/users/mattkrick/events{/privacy}","received_events_url":"https://api.github.com/users/mattkrick/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-08-24T13:01:22Z","updated_at":"2016-08-30T12:44:53Z","closed_at":null,"body":"Doing an @live on something like `teamMembers` should point to `getState().cashay.result.teamMembers`, which will be an array of normalized docs.\r\n"},"comment":{"url":"https://api.github.com/repos/mattkrick/cashay/issues/comments/243426383","html_url":"https://github.com/mattkrick/cashay/issues/112#issuecomment-243426383","issue_url":"https://api.github.com/repos/mattkrick/cashay/issues/112","id":243426383,"user":{"login":"jordanh","id":103000,"avatar_url":"https://avatars.githubusercontent.com/u/103000?v=3","gravatar_id":"","url":"https://api.github.com/users/jordanh","html_url":"https://github.com/jordanh","followers_url":"https://api.github.com/users/jordanh/followers","following_url":"https://api.github.com/users/jordanh/following{/other_user}","gists_url":"https://api.github.com/users/jordanh/gists{/gist_id}","starred_url":"https://api.github.com/users/jordanh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jordanh/subscriptions","organizations_url":"https://api.github.com/users/jordanh/orgs","repos_url":"https://api.github.com/users/jordanh/repos","events_url":"https://api.github.com/users/jordanh/events{/privacy}","received_events_url":"https://api.github.com/users/jordanh/received_events","type":"User","site_admin":false},"created_at":"2016-08-30T12:44:53Z","updated_at":"2016-08-30T12:44:53Z","body":"Ah, of course, the constructor won't work in that case. Another component decorator would work...I could see that. Be nice to avoid it if we can.\r\n\r\nIn your second case:\r\n\r\n> Is it wrong to call cashay.query(subscriptionName)?\r\n\r\nI'm not sure I follow. I need to see a bit more of an example.\r\n\r\nExploring a bit more, how about:\r\n\r\n```javascript\r\nconst str = `query {\r\n  getTeamById(id: $id) @subscription(...variables) {\r\n    id\r\n    name\r\n    teamMembers @live {\r\n      id\r\n      preferredName\r\n      projects {\r\n        id\r\n        content @live\r\n      }\r\n    }\r\n  }\r\n}`\r\n```\r\n\r\nWhere the `variables` passed to the subscription are by default the same as `getTeamById`.\r\n\r\nFirst time through, it sets up the subscription for you. On subsequent calls, the return of the `cashay.query` call always yields the unsubscribe handler.\r\n"}}
{"actor":{"display_login":"jordanh"}}