{"action":"closed","number":976,"pull_request":{"url":"https://api.github.com/repos/lhorie/mithril.js/pulls/976","id":61541864,"html_url":"https://github.com/lhorie/mithril.js/pull/976","diff_url":"https://github.com/lhorie/mithril.js/pull/976.diff","patch_url":"https://github.com/lhorie/mithril.js/pull/976.patch","issue_url":"https://api.github.com/repos/lhorie/mithril.js/issues/976","number":976,"state":"closed","locked":false,"title":"Allow ajax options to specify an additional onreadystatechange function","user":{"login":"mikisvaz","id":54737,"avatar_url":"https://avatars.githubusercontent.com/u/54737?v=3","gravatar_id":"","url":"https://api.github.com/users/mikisvaz","html_url":"https://github.com/mikisvaz","followers_url":"https://api.github.com/users/mikisvaz/followers","following_url":"https://api.github.com/users/mikisvaz/following{/other_user}","gists_url":"https://api.github.com/users/mikisvaz/gists{/gist_id}","starred_url":"https://api.github.com/users/mikisvaz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikisvaz/subscriptions","organizations_url":"https://api.github.com/users/mikisvaz/orgs","repos_url":"https://api.github.com/users/mikisvaz/repos","events_url":"https://api.github.com/users/mikisvaz/events{/privacy}","received_events_url":"https://api.github.com/users/mikisvaz/received_events","type":"User","site_admin":false},"body":"Hi, \r\n\r\nI've needed to set a hook on the onreadystatechange function and I've added the ability to define it on the ajax options.\r\n\r\nI needed this because I would pass some information using cookies that I want to remove as soon as possible:\r\n\r\n```javascript\r\nrbbt.ajax = function(params){\r\n  if (undefined === params.method) params.method = \"GET\"\r\n  if (rbbt.proxy && params.url.indexOf('//') < 0 && params.url.indexOf('/') == 0){\r\n    params.url = rbbt.proxy + params.url\r\n  }else{\r\n    params.config = function(xhr, options){ xhr.setRequestHeader( \"X-Requested-With\", \"XMLHttpRequest\"); return xhr; }\r\n  }\r\n\r\n  if (params.cookies) {\r\n    forHash(params.cookies, function(k,v){ rbbt.set_cookie(k,v) })\r\n\r\n    params.onreadystatechange = function(){\r\n      if (params.cookies){\r\n        forHash(params.cookies, function(k,v){rbbt.remove_cookie(k)})\r\n        params.cookies = undefined\r\n      }\r\n    }\r\n\r\n  }\r\n\r\n  return m.request(params)\r\n}\r\n```\r\nI totally understand if you don't think this is a good idea. I would also appreciate any advice on how to solve my problem better if possible\r\n","created_at":"2016-03-03T10:55:50Z","updated_at":"2016-09-12T12:31:39Z","closed_at":"2016-09-12T12:31:39Z","merged_at":null,"merge_commit_sha":"bdae42e66cc710c514c92bc93e482137fbd861c5","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/lhorie/mithril.js/pulls/976/commits","review_comments_url":"https://api.github.com/repos/lhorie/mithril.js/pulls/976/comments","review_comment_url":"https://api.github.com/repos/lhorie/mithril.js/pulls/comments{/number}","comments_url":"https://api.github.com/repos/lhorie/mithril.js/issues/976/comments","statuses_url":"https://api.github.com/repos/lhorie/mithril.js/statuses/b6bf3523d5fe520e0a3350d8ebf13bd3e8676495","head":{"label":"mikisvaz:next","ref":"next","sha":"b6bf3523d5fe520e0a3350d8ebf13bd3e8676495","user":{"login":"mikisvaz","id":54737,"avatar_url":"https://avatars.githubusercontent.com/u/54737?v=3","gravatar_id":"","url":"https://api.github.com/users/mikisvaz","html_url":"https://github.com/mikisvaz","followers_url":"https://api.github.com/users/mikisvaz/followers","following_url":"https://api.github.com/users/mikisvaz/following{/other_user}","gists_url":"https://api.github.com/users/mikisvaz/gists{/gist_id}","starred_url":"https://api.github.com/users/mikisvaz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikisvaz/subscriptions","organizations_url":"https://api.github.com/users/mikisvaz/orgs","repos_url":"https://api.github.com/users/mikisvaz/repos","events_url":"https://api.github.com/users/mikisvaz/events{/privacy}","received_events_url":"https://api.github.com/users/mikisvaz/received_events","type":"User","site_admin":false},"repo":{"id":53042800,"name":"mithril.js","full_name":"mikisvaz/mithril.js","owner":{"login":"mikisvaz","id":54737,"avatar_url":"https://avatars.githubusercontent.com/u/54737?v=3","gravatar_id":"","url":"https://api.github.com/users/mikisvaz","html_url":"https://github.com/mikisvaz","followers_url":"https://api.github.com/users/mikisvaz/followers","following_url":"https://api.github.com/users/mikisvaz/following{/other_user}","gists_url":"https://api.github.com/users/mikisvaz/gists{/gist_id}","starred_url":"https://api.github.com/users/mikisvaz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikisvaz/subscriptions","organizations_url":"https://api.github.com/users/mikisvaz/orgs","repos_url":"https://api.github.com/users/mikisvaz/repos","events_url":"https://api.github.com/users/mikisvaz/events{/privacy}","received_events_url":"https://api.github.com/users/mikisvaz/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mikisvaz/mithril.js","description":"A Javascript Framework for Building Brilliant Applications (development repo)","fork":true,"url":"https://api.github.com/repos/mikisvaz/mithril.js","forks_url":"https://api.github.com/repos/mikisvaz/mithril.js/forks","keys_url":"https://api.github.com/repos/mikisvaz/mithril.js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mikisvaz/mithril.js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mikisvaz/mithril.js/teams","hooks_url":"https://api.github.com/repos/mikisvaz/mithril.js/hooks","issue_events_url":"https://api.github.com/repos/mikisvaz/mithril.js/issues/events{/number}","events_url":"https://api.github.com/repos/mikisvaz/mithril.js/events","assignees_url":"https://api.github.com/repos/mikisvaz/mithril.js/assignees{/user}","branches_url":"https://api.github.com/repos/mikisvaz/mithril.js/branches{/branch}","tags_url":"https://api.github.com/repos/mikisvaz/mithril.js/tags","blobs_url":"https://api.github.com/repos/mikisvaz/mithril.js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mikisvaz/mithril.js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mikisvaz/mithril.js/git/refs{/sha}","trees_url":"https://api.github.com/repos/mikisvaz/mithril.js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mikisvaz/mithril.js/statuses/{sha}","languages_url":"https://api.github.com/repos/mikisvaz/mithril.js/languages","stargazers_url":"https://api.github.com/repos/mikisvaz/mithril.js/stargazers","contributors_url":"https://api.github.com/repos/mikisvaz/mithril.js/contributors","subscribers_url":"https://api.github.com/repos/mikisvaz/mithril.js/subscribers","subscription_url":"https://api.github.com/repos/mikisvaz/mithril.js/subscription","commits_url":"https://api.github.com/repos/mikisvaz/mithril.js/commits{/sha}","git_commits_url":"https://api.github.com/repos/mikisvaz/mithril.js/git/commits{/sha}","comments_url":"https://api.github.com/repos/mikisvaz/mithril.js/comments{/number}","issue_comment_url":"https://api.github.com/repos/mikisvaz/mithril.js/issues/comments{/number}","contents_url":"https://api.github.com/repos/mikisvaz/mithril.js/contents/{+path}","compare_url":"https://api.github.com/repos/mikisvaz/mithril.js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mikisvaz/mithril.js/merges","archive_url":"https://api.github.com/repos/mikisvaz/mithril.js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mikisvaz/mithril.js/downloads","issues_url":"https://api.github.com/repos/mikisvaz/mithril.js/issues{/number}","pulls_url":"https://api.github.com/repos/mikisvaz/mithril.js/pulls{/number}","milestones_url":"https://api.github.com/repos/mikisvaz/mithril.js/milestones{/number}","notifications_url":"https://api.github.com/repos/mikisvaz/mithril.js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mikisvaz/mithril.js/labels{/name}","releases_url":"https://api.github.com/repos/mikisvaz/mithril.js/releases{/id}","deployments_url":"https://api.github.com/repos/mikisvaz/mithril.js/deployments","created_at":"2016-03-03T10:45:09Z","updated_at":"2016-03-03T10:45:11Z","pushed_at":"2016-03-03T10:50:33Z","git_url":"git://github.com/mikisvaz/mithril.js.git","ssh_url":"git@github.com:mikisvaz/mithril.js.git","clone_url":"https://github.com/mikisvaz/mithril.js.git","svn_url":"https://github.com/mikisvaz/mithril.js","homepage":"http://mithril.js.org","size":4500,"stargazers_count":0,"watchers_count":0,"language":"HTML","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"next"}},"base":{"label":"lhorie:next","ref":"next","sha":"791c94a0b135534754db560beaf710e8137ca756","user":{"login":"lhorie","id":1637573,"avatar_url":"https://avatars.githubusercontent.com/u/1637573?v=3","gravatar_id":"","url":"https://api.github.com/users/lhorie","html_url":"https://github.com/lhorie","followers_url":"https://api.github.com/users/lhorie/followers","following_url":"https://api.github.com/users/lhorie/following{/other_user}","gists_url":"https://api.github.com/users/lhorie/gists{/gist_id}","starred_url":"https://api.github.com/users/lhorie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lhorie/subscriptions","organizations_url":"https://api.github.com/users/lhorie/orgs","repos_url":"https://api.github.com/users/lhorie/repos","events_url":"https://api.github.com/users/lhorie/events{/privacy}","received_events_url":"https://api.github.com/users/lhorie/received_events","type":"User","site_admin":false},"repo":{"id":17814354,"name":"mithril.js","full_name":"lhorie/mithril.js","owner":{"login":"lhorie","id":1637573,"avatar_url":"https://avatars.githubusercontent.com/u/1637573?v=3","gravatar_id":"","url":"https://api.github.com/users/lhorie","html_url":"https://github.com/lhorie","followers_url":"https://api.github.com/users/lhorie/followers","following_url":"https://api.github.com/users/lhorie/following{/other_user}","gists_url":"https://api.github.com/users/lhorie/gists{/gist_id}","starred_url":"https://api.github.com/users/lhorie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lhorie/subscriptions","organizations_url":"https://api.github.com/users/lhorie/orgs","repos_url":"https://api.github.com/users/lhorie/repos","events_url":"https://api.github.com/users/lhorie/events{/privacy}","received_events_url":"https://api.github.com/users/lhorie/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lhorie/mithril.js","description":"A Javascript Framework for Building Brilliant Applications (development repo)","fork":false,"url":"https://api.github.com/repos/lhorie/mithril.js","forks_url":"https://api.github.com/repos/lhorie/mithril.js/forks","keys_url":"https://api.github.com/repos/lhorie/mithril.js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lhorie/mithril.js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lhorie/mithril.js/teams","hooks_url":"https://api.github.com/repos/lhorie/mithril.js/hooks","issue_events_url":"https://api.github.com/repos/lhorie/mithril.js/issues/events{/number}","events_url":"https://api.github.com/repos/lhorie/mithril.js/events","assignees_url":"https://api.github.com/repos/lhorie/mithril.js/assignees{/user}","branches_url":"https://api.github.com/repos/lhorie/mithril.js/branches{/branch}","tags_url":"https://api.github.com/repos/lhorie/mithril.js/tags","blobs_url":"https://api.github.com/repos/lhorie/mithril.js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lhorie/mithril.js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lhorie/mithril.js/git/refs{/sha}","trees_url":"https://api.github.com/repos/lhorie/mithril.js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lhorie/mithril.js/statuses/{sha}","languages_url":"https://api.github.com/repos/lhorie/mithril.js/languages","stargazers_url":"https://api.github.com/repos/lhorie/mithril.js/stargazers","contributors_url":"https://api.github.com/repos/lhorie/mithril.js/contributors","subscribers_url":"https://api.github.com/repos/lhorie/mithril.js/subscribers","subscription_url":"https://api.github.com/repos/lhorie/mithril.js/subscription","commits_url":"https://api.github.com/repos/lhorie/mithril.js/commits{/sha}","git_commits_url":"https://api.github.com/repos/lhorie/mithril.js/git/commits{/sha}","comments_url":"https://api.github.com/repos/lhorie/mithril.js/comments{/number}","issue_comment_url":"https://api.github.com/repos/lhorie/mithril.js/issues/comments{/number}","contents_url":"https://api.github.com/repos/lhorie/mithril.js/contents/{+path}","compare_url":"https://api.github.com/repos/lhorie/mithril.js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lhorie/mithril.js/merges","archive_url":"https://api.github.com/repos/lhorie/mithril.js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lhorie/mithril.js/downloads","issues_url":"https://api.github.com/repos/lhorie/mithril.js/issues{/number}","pulls_url":"https://api.github.com/repos/lhorie/mithril.js/pulls{/number}","milestones_url":"https://api.github.com/repos/lhorie/mithril.js/milestones{/number}","notifications_url":"https://api.github.com/repos/lhorie/mithril.js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lhorie/mithril.js/labels{/name}","releases_url":"https://api.github.com/repos/lhorie/mithril.js/releases{/id}","deployments_url":"https://api.github.com/repos/lhorie/mithril.js/deployments","created_at":"2014-03-17T01:59:39Z","updated_at":"2016-09-12T08:54:57Z","pushed_at":"2016-09-12T12:30:05Z","git_url":"git://github.com/lhorie/mithril.js.git","ssh_url":"git@github.com:lhorie/mithril.js.git","clone_url":"https://github.com/lhorie/mithril.js.git","svn_url":"https://github.com/lhorie/mithril.js","homepage":"http://mithril.js.org","size":7340,"stargazers_count":6477,"watchers_count":6477,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":500,"mirror_url":null,"open_issues_count":63,"forks":500,"open_issues":63,"watchers":6477,"default_branch":"next"}},"_links":{"self":{"href":"https://api.github.com/repos/lhorie/mithril.js/pulls/976"},"html":{"href":"https://github.com/lhorie/mithril.js/pull/976"},"issue":{"href":"https://api.github.com/repos/lhorie/mithril.js/issues/976"},"comments":{"href":"https://api.github.com/repos/lhorie/mithril.js/issues/976/comments"},"review_comments":{"href":"https://api.github.com/repos/lhorie/mithril.js/pulls/976/comments"},"review_comment":{"href":"https://api.github.com/repos/lhorie/mithril.js/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/lhorie/mithril.js/pulls/976/commits"},"statuses":{"href":"https://api.github.com/repos/lhorie/mithril.js/statuses/b6bf3523d5fe520e0a3350d8ebf13bd3e8676495"}},"merged":false,"mergeable":true,"mergeable_state":"clean","merged_by":null,"comments":7,"review_comments":0,"commits":1,"additions":4,"deletions":0,"changed_files":1}}
{"actor":{"display_login":"isiahmeadows"}}