{"action":"created","issue":{"url":"https://api.github.com/repos/shri-2015-org/666/issues/64","labels_url":"https://api.github.com/repos/shri-2015-org/666/issues/64/labels{/name}","comments_url":"https://api.github.com/repos/shri-2015-org/666/issues/64/comments","events_url":"https://api.github.com/repos/shri-2015-org/666/issues/64/events","html_url":"https://github.com/shri-2015-org/666/issues/64","id":107460260,"number":64,"title":"RFC (Request For Comment) по теме API","user":{"login":"tempname11","id":8409150,"avatar_url":"https://avatars.githubusercontent.com/u/8409150?v=3","gravatar_id":"","url":"https://api.github.com/users/tempname11","html_url":"https://github.com/tempname11","followers_url":"https://api.github.com/users/tempname11/followers","following_url":"https://api.github.com/users/tempname11/following{/other_user}","gists_url":"https://api.github.com/users/tempname11/gists{/gist_id}","starred_url":"https://api.github.com/users/tempname11/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tempname11/subscriptions","organizations_url":"https://api.github.com/users/tempname11/orgs","repos_url":"https://api.github.com/users/tempname11/repos","events_url":"https://api.github.com/users/tempname11/events{/privacy}","received_events_url":"https://api.github.com/users/tempname11/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":12,"created_at":"2015-09-21T07:48:47Z","updated_at":"2015-09-21T10:00:18Z","closed_at":null,"body":"Пытаюсь сделать #49. Нужны комментарии, как общие, так и по темам, отмеченным в коде как №1 №2, №3\r\n\r\n@deemidroll @Pofigizm @khokhlachev @naruzl \r\n@alt-j @sullenor \r\n\r\n### common/transport/api.js\r\n```js\r\nimport User from '../../User'\r\nimport Message from '../../Message'\r\n\r\nexport const UP = 'UP';\r\nexport const DOWN = 'DOWN';\r\n// №1: Как описать Direction в терминах jsdoc?\r\n// Он может принимать значения UP или DOWN\r\n\r\n/**\r\n * @class\r\n * @this {LoginRequest}\r\n * @param {string} uid\r\n */\r\nexport class LoginRequest {\r\n  constructor(uid) { // TODO Проверить валидность\r\n    this.uid = uid;\r\n  }\r\n}\r\n\r\n/**\r\n * @class\r\n * @this {MiniMessage} // №2 -- какое лучше выбрать имя?\r\n * @param {string} uid\r\n * @param {string} text\r\n */\r\nexport class MiniMessage {\r\n  constructor(uid, text) { // TODO Проверить валидность\r\n    this.uid = uid;\r\n    this.text = text;\r\n  }\r\n}\r\n\r\n/**\r\n * @class\r\n * @this {Exchange}\r\n * @param {Direction} initialDirection\r\n * @param {Type} requestType\r\n * @param {Type} replyType\r\n */\r\nexport class Exchange {\r\n  constructor(initialDirection, requestType, replyType) {\r\n    this.initialDirection = initialDirection;\r\n    this.requestType = requestType;\r\n    this.replyType = replyType;\r\n  }\r\n}\r\n\r\nexport default {\r\n  newUser:   Notification(DOWN, User);\r\n  login:     Exchange(UP, LoginRequest, User),\r\n  message:   Exchange(UP, MiniMessage, Message),\r\n  read:      Exchange(UP, Message, Message),\r\n  userInfo:  Exchange(UP, User, User),\r\n\r\n  roomUsers: Exchange(UP, undefined, Users),\r\n  // №3: как лучше выразить, что в запросе нет данных?\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/shri-2015-org/666/issues/comments/141929785","html_url":"https://github.com/shri-2015-org/666/issues/64#issuecomment-141929785","issue_url":"https://api.github.com/repos/shri-2015-org/666/issues/64","id":141929785,"user":{"login":"alt-j","id":3763844,"avatar_url":"https://avatars.githubusercontent.com/u/3763844?v=3","gravatar_id":"","url":"https://api.github.com/users/alt-j","html_url":"https://github.com/alt-j","followers_url":"https://api.github.com/users/alt-j/followers","following_url":"https://api.github.com/users/alt-j/following{/other_user}","gists_url":"https://api.github.com/users/alt-j/gists{/gist_id}","starred_url":"https://api.github.com/users/alt-j/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alt-j/subscriptions","organizations_url":"https://api.github.com/users/alt-j/orgs","repos_url":"https://api.github.com/users/alt-j/repos","events_url":"https://api.github.com/users/alt-j/events{/privacy}","received_events_url":"https://api.github.com/users/alt-j/received_events","type":"User","site_admin":false},"created_at":"2015-09-21T10:00:18Z","updated_at":"2015-09-21T10:00:18Z","body":"№3:\r\n- зачем в Exchange передавать requestType?\r\n- в конструкторе `Exchange` тип `requestType` может принимать undefined, это тоже стоит выразить в jsdoc\r\n- `{Type}` непонятный тип данных, или надо завести такой класс (хотя непонятно зачем он нужен), или писать `Object`\r\n- в конструкторах хорошей практикой считается еще минимально описывать ответственность компонента, тоже самое можно делать для непонятных параметров "}}