{"action":"created","comment":{"url":"https://api.github.com/repos/plaidev/bolt-rpc/pulls/comments/72915031","id":72915031,"diff_hunk":"@@ -79,42 +85,53 @@ class Cursor extends Emitter\n     @mdls.push(mdl)\n     return @\n \n-buildChain = (funcs, cb) ->\n-  err = null\n-  val = undefined\n-  _bind = (cur, next) ->\n-    (_err, _val) ->\n-      err = _err if _err\n-      val = _val if _val\n-      cur err, val, next\n-  next = (err, val, next) ->\n-    cb err, val if cb\n-  for cur in Array.prototype.concat(funcs).reverse()\n-    next = _bind(cur, next)\n-  next\n-\n # cursor with track filters\n class TrackCursor extends Cursor\n \n-  constructor: (method, data, options, cb, client) ->\n+  # options.name_space\n+  # options.sub_name_space\n+  # options.track_name_space\n+  # options.track_path\n+  constructor: (client, method, data, options, handler) ->\n \n     # swaps\n-    if 'function' is typeof options\n-      client = cb\n-      cb = options\n+    if typeof options is 'function'\n+      client = handler\n+      handler = options\n       options = {}\n \n+    # enable update by track\n+    @tracking = true\n+\n+    # @pres and @posts are async methods\n+    # @pres -> <client.send> -> @mdls -> (@emit 'end') -> @posts -> @handlerの順に実行\n+    # FIXME: presはtrackからupdateされるケースでしか実行されない\n+    # FIXME: postsはendイベントで飛ぶデータに掛かっていない\n     @pres = []\n     @posts = []\n-    @tracking = true\n \n-    _cb = null\n-    if cb?\n-      _cb = (err, val) =>\n-        next = buildChain(@posts, cb)\n+    _handler = null\n+    if handler?\n+      # FIXME: handlerがなくてもpostsは実行されるべき?\n+      _handler = (err, val) =>\n+        next = __build_chain(@posts, handler)\n         next err, val\n \n-    super(method, data, options, _cb, client)\n+    super(client, method, data, options, handler)\n+\n+    # activate tracking\n+    sub_name_space = @client.sub_name_space\n+    {track_name_space, track_path} = @options\n+\n+    if track_name_space? and track_name_space isnt '__' and track_name_space isnt sub_name_space\n+      @client.join track_name_space","path":"src/client.coffee","position":141,"original_position":141,"commit_id":"dcd5aca13e26e64115dd8278b9346ac2330503fa","original_commit_id":"dcd5aca13e26e64115dd8278b9346ac2330503fa","user":{"login":"nashibao","id":922168,"avatar_url":"https://avatars.githubusercontent.com/u/922168?v=3","gravatar_id":"","url":"https://api.github.com/users/nashibao","html_url":"https://github.com/nashibao","followers_url":"https://api.github.com/users/nashibao/followers","following_url":"https://api.github.com/users/nashibao/following{/other_user}","gists_url":"https://api.github.com/users/nashibao/gists{/gist_id}","starred_url":"https://api.github.com/users/nashibao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nashibao/subscriptions","organizations_url":"https://api.github.com/users/nashibao/orgs","repos_url":"https://api.github.com/users/nashibao/repos","events_url":"https://api.github.com/users/nashibao/events{/privacy}","received_events_url":"https://api.github.com/users/nashibao/received_events","type":"User","site_admin":false},"body":"@otolab これって `@client.sub_name_space` にapi_keyが入って、`track_name_space` に別のが入らない想定、ですよね？そしたらこのコードいらない気がする。（同じ名称にした方がわかりやすい気がする）","created_at":"2016-08-01T00:55:30Z","updated_at":"2016-08-01T00:55:30Z","html_url":"https://github.com/plaidev/bolt-rpc/pull/36#discussion_r72915031","pull_request_url":"https://api.github.com/repos/plaidev/bolt-rpc/pulls/36","_links":{"self":{"href":"https://api.github.com/repos/plaidev/bolt-rpc/pulls/comments/72915031"},"html":{"href":"https://github.com/plaidev/bolt-rpc/pull/36#discussion_r72915031"},"pull_request":{"href":"https://api.github.com/repos/plaidev/bolt-rpc/pulls/36"}}},"pull_request":{"url":"https://api.github.com/repos/plaidev/bolt-rpc/pulls/36","id":78777636,"html_url":"https://github.com/plaidev/bolt-rpc/pull/36","diff_url":"https://github.com/plaidev/bolt-rpc/pull/36.diff","patch_url":"https://github.com/plaidev/bolt-rpc/pull/36.patch","issue_url":"https://api.github.com/repos/plaidev/bolt-rpc/issues/36","number":36,"state":"open","locked":false,"title":"room対応","user":{"login":"otolab","id":6499878,"avatar_url":"https://avatars.githubusercontent.com/u/6499878?v=3","gravatar_id":"","url":"https://api.github.com/users/otolab","html_url":"https://github.com/otolab","followers_url":"https://api.github.com/users/otolab/followers","following_url":"https://api.github.com/users/otolab/following{/other_user}","gists_url":"https://api.github.com/users/otolab/gists{/gist_id}","starred_url":"https://api.github.com/users/otolab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/otolab/subscriptions","organizations_url":"https://api.github.com/users/otolab/orgs","repos_url":"https://api.github.com/users/otolab/repos","events_url":"https://api.github.com/users/otolab/events{/privacy}","received_events_url":"https://api.github.com/users/otolab/received_events","type":"User","site_admin":false},"body":"refs #35, https://github.com/plaidev/karte-io/issues/8558\r\n\r\n互換性の関係で、マイナーバージョンも上げます。1.0.1 => 1.1.0です。","created_at":"2016-07-26T01:14:55Z","updated_at":"2016-08-01T00:55:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"52f2b87ac8b00fdc2aa870cb562f776c75258593","assignee":{"login":"nashibao","id":922168,"avatar_url":"https://avatars.githubusercontent.com/u/922168?v=3","gravatar_id":"","url":"https://api.github.com/users/nashibao","html_url":"https://github.com/nashibao","followers_url":"https://api.github.com/users/nashibao/followers","following_url":"https://api.github.com/users/nashibao/following{/other_user}","gists_url":"https://api.github.com/users/nashibao/gists{/gist_id}","starred_url":"https://api.github.com/users/nashibao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nashibao/subscriptions","organizations_url":"https://api.github.com/users/nashibao/orgs","repos_url":"https://api.github.com/users/nashibao/repos","events_url":"https://api.github.com/users/nashibao/events{/privacy}","received_events_url":"https://api.github.com/users/nashibao/received_events","type":"User","site_admin":false},"assignees":[{"login":"nashibao","id":922168,"avatar_url":"https://avatars.githubusercontent.com/u/922168?v=3","gravatar_id":"","url":"https://api.github.com/users/nashibao","html_url":"https://github.com/nashibao","followers_url":"https://api.github.com/users/nashibao/followers","following_url":"https://api.github.com/users/nashibao/following{/other_user}","gists_url":"https://api.github.com/users/nashibao/gists{/gist_id}","starred_url":"https://api.github.com/users/nashibao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nashibao/subscriptions","organizations_url":"https://api.github.com/users/nashibao/orgs","repos_url":"https://api.github.com/users/nashibao/repos","events_url":"https://api.github.com/users/nashibao/events{/privacy}","received_events_url":"https://api.github.com/users/nashibao/received_events","type":"User","site_admin":false},{"login":"makinoy","id":2972411,"avatar_url":"https://avatars.githubusercontent.com/u/2972411?v=3","gravatar_id":"","url":"https://api.github.com/users/makinoy","html_url":"https://github.com/makinoy","followers_url":"https://api.github.com/users/makinoy/followers","following_url":"https://api.github.com/users/makinoy/following{/other_user}","gists_url":"https://api.github.com/users/makinoy/gists{/gist_id}","starred_url":"https://api.github.com/users/makinoy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/makinoy/subscriptions","organizations_url":"https://api.github.com/users/makinoy/orgs","repos_url":"https://api.github.com/users/makinoy/repos","events_url":"https://api.github.com/users/makinoy/events{/privacy}","received_events_url":"https://api.github.com/users/makinoy/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/plaidev/bolt-rpc/pulls/36/commits","review_comments_url":"https://api.github.com/repos/plaidev/bolt-rpc/pulls/36/comments","review_comment_url":"https://api.github.com/repos/plaidev/bolt-rpc/pulls/comments{/number}","comments_url":"https://api.github.com/repos/plaidev/bolt-rpc/issues/36/comments","statuses_url":"https://api.github.com/repos/plaidev/bolt-rpc/statuses/dcd5aca13e26e64115dd8278b9346ac2330503fa","head":{"label":"plaidev:feature/35","ref":"feature/35","sha":"dcd5aca13e26e64115dd8278b9346ac2330503fa","user":{"login":"plaidev","id":5219279,"avatar_url":"https://avatars.githubusercontent.com/u/5219279?v=3","gravatar_id":"","url":"https://api.github.com/users/plaidev","html_url":"https://github.com/plaidev","followers_url":"https://api.github.com/users/plaidev/followers","following_url":"https://api.github.com/users/plaidev/following{/other_user}","gists_url":"https://api.github.com/users/plaidev/gists{/gist_id}","starred_url":"https://api.github.com/users/plaidev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/plaidev/subscriptions","organizations_url":"https://api.github.com/users/plaidev/orgs","repos_url":"https://api.github.com/users/plaidev/repos","events_url":"https://api.github.com/users/plaidev/events{/privacy}","received_events_url":"https://api.github.com/users/plaidev/received_events","type":"Organization","site_admin":false},"repo":{"id":26162704,"name":"bolt-rpc","full_name":"plaidev/bolt-rpc","owner":{"login":"plaidev","id":5219279,"avatar_url":"https://avatars.githubusercontent.com/u/5219279?v=3","gravatar_id":"","url":"https://api.github.com/users/plaidev","html_url":"https://github.com/plaidev","followers_url":"https://api.github.com/users/plaidev/followers","following_url":"https://api.github.com/users/plaidev/following{/other_user}","gists_url":"https://api.github.com/users/plaidev/gists{/gist_id}","starred_url":"https://api.github.com/users/plaidev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/plaidev/subscriptions","organizations_url":"https://api.github.com/users/plaidev/orgs","repos_url":"https://api.github.com/users/plaidev/repos","events_url":"https://api.github.com/users/plaidev/events{/privacy}","received_events_url":"https://api.github.com/users/plaidev/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/plaidev/bolt-rpc","description":":zap: super fast rpc module which can be extended by middlewares like express.js","fork":false,"url":"https://api.github.com/repos/plaidev/bolt-rpc","forks_url":"https://api.github.com/repos/plaidev/bolt-rpc/forks","keys_url":"https://api.github.com/repos/plaidev/bolt-rpc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/plaidev/bolt-rpc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/plaidev/bolt-rpc/teams","hooks_url":"https://api.github.com/repos/plaidev/bolt-rpc/hooks","issue_events_url":"https://api.github.com/repos/plaidev/bolt-rpc/issues/events{/number}","events_url":"https://api.github.com/repos/plaidev/bolt-rpc/events","assignees_url":"https://api.github.com/repos/plaidev/bolt-rpc/assignees{/user}","branches_url":"https://api.github.com/repos/plaidev/bolt-rpc/branches{/branch}","tags_url":"https://api.github.com/repos/plaidev/bolt-rpc/tags","blobs_url":"https://api.github.com/repos/plaidev/bolt-rpc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/plaidev/bolt-rpc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/plaidev/bolt-rpc/git/refs{/sha}","trees_url":"https://api.github.com/repos/plaidev/bolt-rpc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/plaidev/bolt-rpc/statuses/{sha}","languages_url":"https://api.github.com/repos/plaidev/bolt-rpc/languages","stargazers_url":"https://api.github.com/repos/plaidev/bolt-rpc/stargazers","contributors_url":"https://api.github.com/repos/plaidev/bolt-rpc/contributors","subscribers_url":"https://api.github.com/repos/plaidev/bolt-rpc/subscribers","subscription_url":"https://api.github.com/repos/plaidev/bolt-rpc/subscription","commits_url":"https://api.github.com/repos/plaidev/bolt-rpc/commits{/sha}","git_commits_url":"https://api.github.com/repos/plaidev/bolt-rpc/git/commits{/sha}","comments_url":"https://api.github.com/repos/plaidev/bolt-rpc/comments{/number}","issue_comment_url":"https://api.github.com/repos/plaidev/bolt-rpc/issues/comments{/number}","contents_url":"https://api.github.com/repos/plaidev/bolt-rpc/contents/{+path}","compare_url":"https://api.github.com/repos/plaidev/bolt-rpc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/plaidev/bolt-rpc/merges","archive_url":"https://api.github.com/repos/plaidev/bolt-rpc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/plaidev/bolt-rpc/downloads","issues_url":"https://api.github.com/repos/plaidev/bolt-rpc/issues{/number}","pulls_url":"https://api.github.com/repos/plaidev/bolt-rpc/pulls{/number}","milestones_url":"https://api.github.com/repos/plaidev/bolt-rpc/milestones{/number}","notifications_url":"https://api.github.com/repos/plaidev/bolt-rpc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/plaidev/bolt-rpc/labels{/name}","releases_url":"https://api.github.com/repos/plaidev/bolt-rpc/releases{/id}","deployments_url":"https://api.github.com/repos/plaidev/bolt-rpc/deployments","created_at":"2014-11-04T09:48:40Z","updated_at":"2016-02-10T00:57:31Z","pushed_at":"2016-07-29T13:03:00Z","git_url":"git://github.com/plaidev/bolt-rpc.git","ssh_url":"git@github.com:plaidev/bolt-rpc.git","clone_url":"https://github.com/plaidev/bolt-rpc.git","svn_url":"https://github.com/plaidev/bolt-rpc","homepage":"http://plaidev.github.io/bolt-rpc/","size":240,"stargazers_count":4,"watchers_count":4,"language":"CoffeeScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":2,"mirror_url":null,"open_issues_count":7,"forks":2,"open_issues":7,"watchers":4,"default_branch":"master"}},"base":{"label":"plaidev:master","ref":"master","sha":"d294e0543593d5129b0cb1c5a0bce1e7eb5aaf45","user":{"login":"plaidev","id":5219279,"avatar_url":"https://avatars.githubusercontent.com/u/5219279?v=3","gravatar_id":"","url":"https://api.github.com/users/plaidev","html_url":"https://github.com/plaidev","followers_url":"https://api.github.com/users/plaidev/followers","following_url":"https://api.github.com/users/plaidev/following{/other_user}","gists_url":"https://api.github.com/users/plaidev/gists{/gist_id}","starred_url":"https://api.github.com/users/plaidev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/plaidev/subscriptions","organizations_url":"https://api.github.com/users/plaidev/orgs","repos_url":"https://api.github.com/users/plaidev/repos","events_url":"https://api.github.com/users/plaidev/events{/privacy}","received_events_url":"https://api.github.com/users/plaidev/received_events","type":"Organization","site_admin":false},"repo":{"id":26162704,"name":"bolt-rpc","full_name":"plaidev/bolt-rpc","owner":{"login":"plaidev","id":5219279,"avatar_url":"https://avatars.githubusercontent.com/u/5219279?v=3","gravatar_id":"","url":"https://api.github.com/users/plaidev","html_url":"https://github.com/plaidev","followers_url":"https://api.github.com/users/plaidev/followers","following_url":"https://api.github.com/users/plaidev/following{/other_user}","gists_url":"https://api.github.com/users/plaidev/gists{/gist_id}","starred_url":"https://api.github.com/users/plaidev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/plaidev/subscriptions","organizations_url":"https://api.github.com/users/plaidev/orgs","repos_url":"https://api.github.com/users/plaidev/repos","events_url":"https://api.github.com/users/plaidev/events{/privacy}","received_events_url":"https://api.github.com/users/plaidev/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/plaidev/bolt-rpc","description":":zap: super fast rpc module which can be extended by middlewares like express.js","fork":false,"url":"https://api.github.com/repos/plaidev/bolt-rpc","forks_url":"https://api.github.com/repos/plaidev/bolt-rpc/forks","keys_url":"https://api.github.com/repos/plaidev/bolt-rpc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/plaidev/bolt-rpc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/plaidev/bolt-rpc/teams","hooks_url":"https://api.github.com/repos/plaidev/bolt-rpc/hooks","issue_events_url":"https://api.github.com/repos/plaidev/bolt-rpc/issues/events{/number}","events_url":"https://api.github.com/repos/plaidev/bolt-rpc/events","assignees_url":"https://api.github.com/repos/plaidev/bolt-rpc/assignees{/user}","branches_url":"https://api.github.com/repos/plaidev/bolt-rpc/branches{/branch}","tags_url":"https://api.github.com/repos/plaidev/bolt-rpc/tags","blobs_url":"https://api.github.com/repos/plaidev/bolt-rpc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/plaidev/bolt-rpc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/plaidev/bolt-rpc/git/refs{/sha}","trees_url":"https://api.github.com/repos/plaidev/bolt-rpc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/plaidev/bolt-rpc/statuses/{sha}","languages_url":"https://api.github.com/repos/plaidev/bolt-rpc/languages","stargazers_url":"https://api.github.com/repos/plaidev/bolt-rpc/stargazers","contributors_url":"https://api.github.com/repos/plaidev/bolt-rpc/contributors","subscribers_url":"https://api.github.com/repos/plaidev/bolt-rpc/subscribers","subscription_url":"https://api.github.com/repos/plaidev/bolt-rpc/subscription","commits_url":"https://api.github.com/repos/plaidev/bolt-rpc/commits{/sha}","git_commits_url":"https://api.github.com/repos/plaidev/bolt-rpc/git/commits{/sha}","comments_url":"https://api.github.com/repos/plaidev/bolt-rpc/comments{/number}","issue_comment_url":"https://api.github.com/repos/plaidev/bolt-rpc/issues/comments{/number}","contents_url":"https://api.github.com/repos/plaidev/bolt-rpc/contents/{+path}","compare_url":"https://api.github.com/repos/plaidev/bolt-rpc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/plaidev/bolt-rpc/merges","archive_url":"https://api.github.com/repos/plaidev/bolt-rpc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/plaidev/bolt-rpc/downloads","issues_url":"https://api.github.com/repos/plaidev/bolt-rpc/issues{/number}","pulls_url":"https://api.github.com/repos/plaidev/bolt-rpc/pulls{/number}","milestones_url":"https://api.github.com/repos/plaidev/bolt-rpc/milestones{/number}","notifications_url":"https://api.github.com/repos/plaidev/bolt-rpc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/plaidev/bolt-rpc/labels{/name}","releases_url":"https://api.github.com/repos/plaidev/bolt-rpc/releases{/id}","deployments_url":"https://api.github.com/repos/plaidev/bolt-rpc/deployments","created_at":"2014-11-04T09:48:40Z","updated_at":"2016-02-10T00:57:31Z","pushed_at":"2016-07-29T13:03:00Z","git_url":"git://github.com/plaidev/bolt-rpc.git","ssh_url":"git@github.com:plaidev/bolt-rpc.git","clone_url":"https://github.com/plaidev/bolt-rpc.git","svn_url":"https://github.com/plaidev/bolt-rpc","homepage":"http://plaidev.github.io/bolt-rpc/","size":240,"stargazers_count":4,"watchers_count":4,"language":"CoffeeScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":2,"mirror_url":null,"open_issues_count":7,"forks":2,"open_issues":7,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/plaidev/bolt-rpc/pulls/36"},"html":{"href":"https://github.com/plaidev/bolt-rpc/pull/36"},"issue":{"href":"https://api.github.com/repos/plaidev/bolt-rpc/issues/36"},"comments":{"href":"https://api.github.com/repos/plaidev/bolt-rpc/issues/36/comments"},"review_comments":{"href":"https://api.github.com/repos/plaidev/bolt-rpc/pulls/36/comments"},"review_comment":{"href":"https://api.github.com/repos/plaidev/bolt-rpc/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/plaidev/bolt-rpc/pulls/36/commits"},"statuses":{"href":"https://api.github.com/repos/plaidev/bolt-rpc/statuses/dcd5aca13e26e64115dd8278b9346ac2330503fa"}}}}
{"actor":{"display_login":"nashibao"}}